matplotlib中subplots如何调整子图间矩-创新互联

这篇文章主要为大家展示了“matplotlib中subplots如何调整子图间矩”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“matplotlib中subplots如何调整子图间矩”这篇文章吧。

创新互联长期为成百上千客户提供的网站建设服务,团队从业经验10年,关注不同地域、不同群体,并针对不同对象提供差异化的产品和服务;打造开放共赢平台,与合作伙伴共同营造健康的互联网生态环境。为丹东企业提供专业的成都做网站、成都网站设计,丹东网站改版等技术服务。拥有十年丰富建站经验和众多成功案例,为您定制开发。

在matplotlib中,用subplots画子图时,有时候需要调整子图间矩,包括子图与边框的间矩,子图间上下间矩,子图间左右间矩,可以使用fig.tight_layout()函数:

Help on method tight_layout in module matplotlib.figure:

tight_layout(renderer=None, pad=1.08, h_pad=None, w_pad=None, rect=None) method of matplotlib.figure.Figure instance
  Adjust subplot parameters to give specified padding.
  
  Parameters:
  
   *pad* : float
    padding between the figure edge and the edges of subplots,
    as a fraction of the font-size.
   *h_pad*, *w_pad* : float
    padding (height/width) between edges of adjacent subplots.
    Defaults to `pad_inches`.
   *rect* : if rect is given, it is interpreted as a rectangle
    (left, bottom, right, top) in the normalized figure
    coordinate that the whole subplots area (including
    labels) will fit into. Default is (0, 0, 1, 1).

以上是“matplotlib中subplots如何调整子图间矩”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注创新互联成都网站设计公司行业资讯频道!

另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


网页标题:matplotlib中subplots如何调整子图间矩-创新互联
文章分享:http://scyanting.com/article/cechch.html