小编chr*_*203的帖子

如何在matplotlib中以多行获取x轴标签?

我正在尝试将很长的 x 轴标签变为多行,如右图所示:

示例图像

我目前使用的代码:

ax = cluster3.plot(x='Neighborhood',y=['Population'],kind='bar',alpha=0.75,title='Population of Each Neighborhood',figsize=(15, 10))
ax.set_ylabel('Population')
Run Code Online (Sandbox Code Playgroud)

cluster3 是具有 Neighborhood 列的数据框

python matplotlib python-3.x

6
推荐指数
2
解决办法
4387
查看次数

标签 统计

matplotlib ×1

python ×1

python-3.x ×1