代码之家  ›  专栏  ›  技术社区  ›  user3668129

用户警告:未应用紧凑布局。tight_layout无法使轴的高度小到足以容纳所有轴装饰

  •  0
  • user3668129  · 技术社区  · 3 年前

    我正在尝试创建多个子画面的方框图:

    fig, axs = plt.subplots(7, 2)
    for ax, feature in zip(axs.flatten(), df.columns):
        
        title = "column: {}".format(feature)
        df.boxplot(column=feature, ax=ax)
        ax.set_title(title)               
    plt.tight_layout()
    plt.show()
    

    但我的情节太紧凑了: enter image description here

    尝试使用时 tight_layout 我在打仗:

    UserWarning: Tight layout not applied. tight_layout cannot make axes height small enough to accommodate all axes decorations
    

    如何以可读的方式显示子画面?

    0 回复  |  直到 3 年前