Enthought + PyCharm - cannot show plots anymore

不羁岁月 提交于 2019-12-08 08:24:52

问题


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

~/Library/Enthought/Canopy_64bit/User

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()

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.


回答1:


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 is more than likely not configured in interactive mode with matplotlib.



来源:https://stackoverflow.com/questions/22856355/enthought-pycharm-cannot-show-plots-anymore

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!