2014-04-04 29 views
1

我在Mac OS X PyCharm與Enthought設置爲解釋:Enthought + PyCharm - 不能顯示地塊再

~/Library/Enthought/Canopy_64bit/User 

但是,它並沒有顯示出任何來自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]: <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() 

PyCharm很可能未配置爲與matplotlib交互模式。