1
我想在多個窗口中繪製燭臺圖表。在通常的折線圖中,我可以使用plt.figure()
,plt.plot()
然後plt.show()
。但這對燭臺不起作用。任何人都可以幫助解決這個問題嗎?Matplotlib燭臺:如何顯示多個窗口?
import matplotlib.pyplot as plt
from matplotlib.finance import candlestick_ohlc
num,op,hi,lo,cl= np.loadtxt('AUDUSDdaily3.csv',
unpack=True,
delimiter=',')
ax1=plt.subplot2grid((1,1),(0,0))
x=0
y=len(num)
ohlc=[]
while x<y:
d1=num[x],op[x],hi[x],lo[x],cl[x]
ohlc.append(d1)
x+=1
plt.figure(1)
candlestick_ohlc(ax1,ohlc[0:50],width=0.4)
plt.figure(2)
candlestick_ohlc(ax1,ohlc[150:200],width=0.4)
plt.show()
Thanks! .....並且非常感謝超級快速響應! –
很高興我能幫到你。由於這是您的第一個問題,因此您可能需要參加[導覽]並閱讀[如果有人回答該怎麼辦](https://stackoverflow.com/help/someone-answers) – ImportanceOfBeingErnest