1. 程式人生 > >python matplotlib中axes與subplot

python matplotlib中axes與subplot

line 很好 http images image pytho 畫圖 img 區別

使用pyplot直接畫圖和創建figure對象後,使用方法畫圖:

技術分享圖片

在使用的時候,根據具體的需求選擇,如果不需要子圖,直接使用pyplot方法就可以實現。

技術分享圖片

1.2Axes 和 Subplot 的概念上細微的區別

技術分享圖片

subplot()方法很好理解,前兩個數字代表生成幾行幾列的子圖矩陣,最後一個數字代表選中的子圖位置。

技術分享圖片

這個例子為add_axes()方法。

axes對象本身可以理解為子圖。

技術分享圖片

python matplotlib中axes與subplot