python繪制圖標——圖表調整​​​​​​​subplots_adjust


對於subplots_adjust()函數,我們可以想象成對word頁面布局的調整
 
​​​​​​​說明、參數
Adjusting the spacing of margins and subplots調整邊距和子圖的間距
 
subplots_adjust(self, left=None, bottom=None, right=None, top=None,wspace=None, hspace=None)
 
Tune the subplot layout.調整子圖布局。
The parameter meanings (and suggested defaults) are:參數含義(和建議的默認值)是:
left  = 0.125  # the left side of the subplots of the figure圖片中子圖的左側
right = 0.9    # the right side of the subplots of the figure圖片中子圖的右側
bottom = 0.1   # the bottom of the subplots of the figure圖片中子圖的底部
top = 0.9      # the top of the subplots of the figure圖片中子圖的頂部
wspace = 0.2   # the amount of width reserved for space between subplots,
               # expressed as a fraction of the average axis width
#為子圖之間的空間保留的寬度,平均軸寬的一部分
hspace = 0.2   # the amount of height reserved for space between subplots,
               # expressed as a fraction of the average axis height
#為子圖之間的空間保留的高度,平均軸高度的一部分
加了這個語句,子圖會稍變小,因為空間也占用坐標軸的一部分
fig.subplots_adjust(wspace=0.5,hspace=0.5)
 
​​​​​​​對比效果圖:
右圖是加加了subplots_adjust的


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM