为pandas boxplot(groupby)设置无标题 [英] Set no title for pandas boxplot (groupby)

查看:119
本文介绍了为pandas boxplot(groupby)设置无标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在绘制按另一列分组的pandas箱形图时,pandas会自动在图上添加标题,即"Boxplot by ....".有没有办法删除它?我尝试使用

When drawing a pandas boxplot, grouped by another column, pandas automatically adds a title to the plot, saying 'Boxplot grouped by....'. Is there a way to remove that? I tried using

suptitle('')

按照>熊猫:基于另一列的一列箱线图列

但是这似乎不起作用.我正在使用最新的熊猫(0.13.1)版本.

but this does not seem to work. I am using latest pandas (0.13.1) version.

推荐答案

请确保在正确的图形上调用 suptitle('').

Make sure your calling suptitle('') on the right figure.

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>

这篇关于为pandas boxplot(groupby)设置无标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆