Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set no title for pandas boxplot (groupby)

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('') 

as per Pandas: boxplot of one column based on another column

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

like image 475
user308827 Avatar asked May 07 '14 01:05

user308827


People also ask

How do you put a title on a panda boxplot?

Pandas Boxplot Title You can add a title to your boxplot by turning to the pyplot module. Now you have a title to inform any newcomers what this boxplot represents so they can understand it quicker. This final customization returns to the arguments of the . boxplot method.

How do you label a boxplot in Python?

tick_params(axis='both',which='major',direction='in',length=4,width=2,labelsize=8) ax. tick_params(axis='both',which='minor',direction='in',length=2,width=1.5) # and so on...you can do the same for the y-axis.

How do you make a boxplot for each feature in the dataset?

To draw a box plot for the given data first we need to arrange the data in ascending order and then find the minimum, first quartile, median, third quartile and the maximum. To find the First Quartile we take the first six values and find their median. For the Third Quartile, we take the next six and find their median.

How do I label axis in pandas?

You can set the labels on that object. Or, more succinctly: ax. set(xlabel="x label", ylabel="y label") . Alternatively, the index x-axis label is automatically set to the Index name, if it has one.


1 Answers

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> 
like image 161
TomAugspurger Avatar answered Oct 02 '22 14:10

TomAugspurger