Set no title for pandas boxplot (groupby) Set no title for pandas boxplot (groupby) python python

Set no title for pandas boxplot (groupby)


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>


I had the same problem. Ended up using this solution

import matplotlib.pyplot as plt    # df is your dataframedf.boxplot(column='value', by='category')title_boxplot = 'awesome title'plt.title( title_boxplot )plt.suptitle('') # that's what you're afterplt.show()


I as having problems with this and generally never liked the canned title that the pandas was adding as it was dependent on the column names which are typically never publishing ready.

You can edit the source code in ~\pandas\plotting\_core.py

On line 2698 you will find:

fig.suptitle('Boxplot grouped by {byline}'.format(byline=byline))

Simple comment this line out and pandas will no longer add the title to the top of the boxplot by default. You will have to redo this change as you upgrade pandas versions.