python绘图子图间距调整:subplots_adjust

python绘图子图间距调整:subplots_adjust

官网注释

我是个初学者,个人认为不懂的可以先看看官网的文档,再去百度什么的,理解别人的代码。
链接:https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.subplots_adjust.html?highlight=subplots_adjust

matplotlib.pyplot.subplots_adjust(函数名

matplotlib.pyplot.subplots_adjust(left=None, bottom=None, right=None,
top=None, wspace=None, hspace=None)
(前四个含义——单独子图的参数调整:左、下、右、上预留距离,默认为无。)
(后两个含义——子图之间的参数调整:横向间隔距离、纵向间隔距离)

Adjust the subplot layoutparameters.(用途:子图布局参数调整

Unset parameters are left unmodified;
initial values are given by rcParams[“figure.subplot.[name]”].
(未设置的参数保持不变;初始值由 给出 rcParams[“figure.subplot.[name]”]。)
这里涉及到 rcParams的设置,我也不太懂,可以设置字体语言和样式这些,比如:

plt.rcParams[‘font.sans-serif’] =[‘Microsoft YaHei’]
plt.rcParams[‘axes.unicode_minus’] = False)

参数的官网解释
1.Parameters leftfloat, optional The position of the left edge of the subplots, as a fraction of the figure width.
(左:浮点数,可选子图左边缘的位置,作为图形宽度的一部分。)
2. rightfloat, optional The position of the right edge of the subplots, as a fraction of the figure width.
(右:浮点数,可选子图右边缘的位置,作为图形宽度的一部分。)
3. bottomfloat, optional The position of the bottom edge of the subplots, as a fraction of the figure height.
(底部:浮点数,可选子图底部边缘的位置,作为图形高度的一部分。)
4. topfloat, optional The position of the top edge of the subplots, as a fraction of the figure height.
(顶部:浮点数,可选子图上边缘的位置,作为图形高度的一部分。)
5.wspacefloat, optional The width of the padding between subplots, as a fraction of the average Axes width.
(wspace:浮点数,可选子图之间的填充宽度,作为平均轴宽度的一部分。)
6.hspacefloat, optional The height of the padding between subplots, as a fraction of the average Axes height.
(hspace:浮点数,可选子图之间的填充高度,作为平均轴高度的一部分。)

  • 3
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值