簡體   English   中英

無法填充整個布局時,如何修復matplotlib的子圖?

[英]How to fix matplotlib's subplots when the entire layout can not be filled?

我想繪制一個包含29列的DataFrame,所以我使用matplotlib的“ subplots”命令,該命令使用5x6布局,(5x6 = 30> 29)

無花果,ax = plt.subplots(5,6)

但是,當我繪制所有列時,最后一個子圖(即row = 5,col = 6)為空,因為那里沒有數據可顯示。 有沒有辦法刪除最后一個子圖?

嘗試這個

fig.delaxes(axs[5,6]) 
plt.show()

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM