I'm currently trying to run a python script whose end goal is to show a figure. It skeletally looks like:
import matplotlib.pyplot as p
p.figure()
[build figure, create plots]
p.show()
I'm trying to run this script remotely. It's located on another machine, and I'm trying to run it while ssh'd from my laptop, using:
$ ssh -X 'myusername'@'myhostname'
However, whenever I execute my script, I get the following error, raised by p.show()
:
This program needs access to the screen.
Please run with 'pythonw', not 'python', and only when you are logged
in on the main display of your Mac.
When I run with pythonw instead of python, I get the same error. Is there any way to configure matplotlib
and ssh
to be able to show or save plot files on remote machines?