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

seaborn的标题和标签在边界上[重复]

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

    我正在和seaborn做一件简单的事

    然而,当我这样做的时候

    ax2=sns.displot(outlist)
    ax2.set(xlabel='Rate(Hz)', title='Distribution of publication rates')
    

    我得到了

    problem

    如何正确放置标题和标签?

    1 回复  |  直到 3 年前
        1
  •  2
  •   mwaskom    3 年前

    使用 tight_layout :

    g = sns.displot(outlist)
    g.set(xlabel='Rate(Hz)', title='Distribution of publication rates')
    g.tight_layout()