python figure & ax

fig = plt.figure("name")   #最好取個名字, 以後可以在多個figure之間分換

ax0 = fig.add_subplot(221)  
ax1 = fig.add_subplot(222, sharex=ax0)  

ax2 = fig.add_subplot(223, sharex=ax0)   
ax2 = fig.add_subplot(224, sharex=ax0, sharey=ax0) 

  
如果有多個figure,只要在plot之前先指定 plot.figure("name") 即可,如下。

plot.figure("a")
plot.plot(x,y,'-')

plot.figure("b")
plot.plot(x,y,'v')

留言

這個網誌中的熱門文章

python 找圖自動點擊

Python pyserial 抓取系統內的 COM PORT

VBA EXCEL 工作表變化 馬上執行 的作法 Worksheet_Change