Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pandas subplot title size in ipython notebook

I plotted two plots side by side in an ipython notebook cell. But, I am having trouble changing the size of the title. I can change the size of the labels by adding the argument fontsize = 20. How do I change the title for df and df2.

fig, axes = plt.subplots(ncols=2, figsize = (20,10))
df.plot('barh', title = 'Legal Collectible Answer Distribution', fontsize = 20, ax = axes[0])
df2.plot(kind = 'pie', autopct = '%1.0f%%', legend = False, title = 'Legal Collectible Answer Distribution', fontsize = 20, ax =axes[1])
like image 303
collarblind Avatar asked Feb 23 '16 16:02

collarblind


1 Answers

You can change the size of an existing title on the Axes using title.set_size()

axes[0].title.set_size(40)
like image 85
tmdavison Avatar answered Sep 21 '22 17:09

tmdavison