2016-09-30 46 views
0

當我執行的代碼,這一塊的程序產生[None, None, None,...]燭臺功能不顯示結果

我期待燭圖

import matplotlib.finance as mpf 
import matplotlib.pyplot as plt 

start =(2014,5,1)  
end = (2014,6,30) 

quotes = mpf.quotes_historical_yahoo_ochl('^GDAXI',start, end) 
fig, ax=plt.subplots(figsize=(8,5)) 
fig.subplots_adjust(bottom=0.2) 
mpf.candlestick_ochl(ax,quotes,width=0.6,colorup='b',colordown='r') 
plt.grid(True) 
ax.xaxis_date() 
ax.autoscale_view() 
plt.setp(plt.gca().get_xticklabels(),rotation=30) 

回答

0

你實際上並沒有show您的情節在屏幕上。當我複製你的代碼並添加

plt.show() 

在它結束時,它運行得很好。

+0

非常感謝。我在編程方面很新穎。有用!!! – user2560244