【问题标题】:How to increase the x-axis plot size in seaborn?如何增加seaborn中的x轴绘图大小?
【发布时间】:2021-01-07 05:10:36
【问题描述】:

我正在尝试使用 seaborn 为不同的职业绘制图表,但我无法识别 x 轴上的标签。这是图表的图像

【问题讨论】:

  • 尝试plt.xticks(rotation=70) 旋转标签
  • “x 轴绘图大小”是什么意思?请更准确。

标签: matplotlib graph seaborn data-science figsize


【解决方案1】:

正如评论中提到的@Karthik,我尝试过旋转标签

ax = sns.countplot(x="Profession", data=df)

ax.set_xticklabels(ax.get_xticklabels(), rotation=40, ha="right")
plt.tight_layout()
plt.show()

成功了

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-03-11
    • 2018-03-12
    • 1970-01-01
    • 2019-06-02
    • 2017-12-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多