matplotlib.pyplot.subplots_adjust解析

官方文档:

def subplots_adjust(self, left=None, bottom=None, right=None, top=None, wspace=None, hspace=None)

	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

参数含义:

left, right, bottom, top:子图所在区域的边界。
当值大于1.0的时候子图会超出figure的边界从而显示不全;值不大于1.0的时候,子图会自动分布在一个矩形区域(下图灰色部分)。
要保证left < right, bottom < top,否则会报错。
如下图:
left, right, top, bottom

wspace, hspace:子图之间的横向和纵向间距。
无论如何所有子图都不会超出left, right, top, bottom所围区域。子图的长宽比不变,而是按比例缩小,所以调整横向间距也可能影响纵向间距,反之亦然。
如下图:

wspace, hspace

 

  • 3
    点赞
  • 21
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值