在matplotlib.pyplot上远程运行“show()”命令

时间:2013-08-06 21:50:14

标签: user-interface ssh matplotlib plot

我目前正在尝试运行一个python脚本,其最终目标是显示一个数字。它的骨架看起来像:

import matplotlib.pyplot as p

p.figure()

[build figure, create plots]

p.show()

我正在尝试远程运行此脚本。它位于另一台机器上,我正试图在我的笔记本电脑ssh'd运行它,使用:

$ ssh -X 'myusername'@'myhostname'

但是,每当我执行脚本时,都会收到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.

当我使用pythonw而不是python运行时,我得到了同样的错误。有没有办法配置matplotlibssh能够在远程计算机上显示或保存绘图文件?

0 个答案:

没有答案