Enthought + PyCharm - 不能再显示情节了

Foo*_*Bar 1 python plot enthought pycharm

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

~/Library/Enthought/Canopy_64bit/User
Run Code Online (Sandbox Code Playgroud)

但是,它没有显示来自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()
Run Code Online (Sandbox Code Playgroud)

这只是给了我Out[124]: <matplotlib.axes.AxesSubplot at 0x10dd29f90>.它没有显示情节,也没有做任何其他事情.没有错误,没有.

小智 7

你错过了对将显示绘图项的show()函数的调用.

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()
Run Code Online (Sandbox Code Playgroud)

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