简体   繁体   English

使用X11转发时的pyplot

[英]pyplot while using X11 forwarding

I'm trying to setup my remote working environment so that I can use matplotlib.pyplot under ipython. 我正在尝试设置我的远程工作环境,以便我可以在ipython下使用matplotlib.pyplot My local machine and remote machine are both MAC OSX Mavericks. 我的本地机器和远程机器都是MAC OSX Mavericks。 I've tried xeyes and it works properly so I think my X11 forwarding works fine. 我已经尝试了xeyes并且它正常工作所以我认为我的X11转发工作正常。 However, when I try functions in matplotlib.pyplot it didn't show any error message but I didn't see any figure either. 但是,当我在matplotlib.pyplot尝试函数时,它没有显示任何错误消息,但我也没有看到任何数字。

I know it's about which backend to use and I've tried using ipython --pylab=tk but didn't work. 我知道这是关于使用哪个后端,我尝试使用ipython --pylab=tk但是没有用。 Tried to install pygtk but can't manage to install a dependency py2cairo (seems to be an open issue ). 试图安装pygtk但无法设法安装依赖py2cairo (似乎是一个开放的问题 )。 Any other thoughts? 还有其他想法吗? Thanks. 谢谢。

How did you "try functions in matplotlib.pyplot"? 你是怎么“在matplotlib.pyplot中尝试函数”的?

The following works for me 以下适用于我

import matplotlib
matplotlib.use('tkagg')
import matplotlib.pyplot as plt
plt.plot([1, 2, 3])
plt.show()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM