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

Python中的Xlabel绘图错误

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

    我试图用python制作直方图,但我的x轴标签相互重叠: enter image description here

    我使用的代码如下:

    sns.set_context("paper", font_scale=2, rc={"font.size": 20, "axes.titlesize": 25, "axes.labelsize": 20})
    sns.catplot(kind='count', data=df, x='age', hue='target', order=df['age'].sort_values().unique())
    plt.title('Variation of Age')
    plt.show()
    

    如何使x轴标签看起来好看?

    0 回复  |  直到 3 年前