Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

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?

share|improve this question
add comment (requires an account with 50 reputation)

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.