当画一个熊猫盒子图,按另一栏分组时,熊猫会自动添加一个标题,上面写着“按…分组的盒子图”。有什么办法把它去掉吗?我试着用
suptitle('')但这似乎行不通。我正在使用最新的熊猫(0.13.1)版本。
发布于 2014-05-07 03:31:26
确保您在正确的数字上调用suptitle('')。
In [23]: axes = df.boxplot(by='g')
In [24]: fig = axes[0][0].get_figure()
In [25]: fig.suptitle('')
Out[25]: <matplotlib.text.Text at 0x109496090>发布于 2019-01-20 18:06:39
我也有同样的问题。最后使用这个解决方案
import matplotlib.pyplot as plt
# df is your dataframe
df.boxplot(column='value', by='category')
title_boxplot = 'awesome title'
plt.title( title_boxplot )
plt.suptitle('') # that's what you're after
plt.show()发布于 2021-08-10 10:59:23
在尝试了所有建议之后,只有此修改对我有效,这也允许您修改其他参数:
ax = df.boxplot(by ='value', column =['category'], grid = False);
plt.title('')
plt.suptitle('')
ax.set_title('');
ax.set_xlabel("x_label");
ax.set_ylabel("y_label");
ax = plt.show()https://stackoverflow.com/questions/23507229
复制相似问题