macOS is NOT X11 based.
Yes, you can install XQuartz, but then ONLY programs explicitly written to use X11, such as xterm, xclock, xeyes, etc… will actually send their windows to the X11 display server.
Python, installed on macOS, is not X11 based, so it is not going to open remote X11 windows for its output.
If the remote machine is another Mac, then macOS Screen Sharing is how you can see the plot.
If a Linux/Unix based system, then VNC. It is possible to configure System Settings-> General-> Sharing-> Screen Sharing to have a VNC password, and allow VNC clients to connect.
If VNC security is important, when you make your ssh connection, create a VNC tunnel
ssh -L 5922:localhost:5900 the.Macs.addr
And on your Linux/Unix system connect your VNC client to localhost:5922
TigerVNC is the VNC client we use at work, although our use is mostly from Macs to Linux/Unix development systems, but TigerVNC is available for the *nix based systems.
Mac-to-Mac Screen Sharing is already an encrypted connection.