Enthought + PyCharm - 无法再显示图 [英] Enthought + PyCharm - cannot show plots anymore

查看:45
本文介绍了Enthought + PyCharm - 无法再显示图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Mac OS X PyCharm 上将 Enthought 设置为解释器:

I have on Mac OS X PyCharm with Enthought set up as interpreter:

~/Library/Enthought/Canopy_64bit/User

但是,它没有显示来自 matplotlib 的任何图.

However, it does not show any of the plots from matplotlib.

import pandas as pd
from numpy import *
import matplotlib.pyplot as plt
ts = pd.Series(random.randn(1000), index=pd.date_range('1/1/2000', periods=1000))
ts = ts.cumsum()
ts.plot()

这只是给了我 Out[124]: .它不显示情节,也不做任何其他事情.没有错误,没有.

This just gives me Out[124]: <matplotlib.axes.AxesSubplot at 0x10dd29f90>. It does not show the plot, nor does it do anything else. No error, nothing.

推荐答案

您缺少对将显示绘图项目的 show() 函数的调用.

You're missing the call to the show() function that will display the plot items.

import pandas as pd
from numpy import *
import matplotlib.pyplot as plt
ts = pd.Series(random.randn(1000), index=pd.date_range('1/1/2000', periods=1000))
ts = ts.cumsum()
ts.plot()
plt.show()

PyCharm 很可能没有在与 matplotlib 的交互模式下配置.

PyCharm is more than likely not configured in interactive mode with matplotlib.

这篇关于Enthought + PyCharm - 无法再显示图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆