【问题标题】:How to avoid boxplot categories being too close to each other?如何避免箱线图类别彼此过于接近?
【发布时间】:2017-12-05 10:33:37
【问题描述】:

如何避免箱线图类别彼此过于接近?看我上传的图片,我都认不出字了。

# Residual vs Category
census_subdivision_without_lower_mainland_and_van_island.boxplot(column='residual',by='CNMCRGNNM')
plt.savefig('../output/linear_model/residual_vs_region.png')
plt.clf()

【问题讨论】:

  • 尝试使用 plt.axis[,500,500,-200,200] 将 x_ticks 设置得更分开 --> 尝试不同的值。分别宽figsize。如果您加载创建绘图的代码,我将尝试显示它

标签: python pandas matplotlib statistics boxplot


【解决方案1】:

通过将rot=90 传递给boxplot() 来旋转箱线图轴标签:

census_subdivision_without_lower_mainland_and_van_island.boxplot(column='residual',by='CNMCRGNNM', rot=90)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-10-07
    • 2021-12-19
    • 2022-01-01
    • 2014-04-26
    • 2019-12-07
    • 1970-01-01
    • 2022-01-17
    • 1970-01-01
    相关资源
    最近更新 更多