![]() plt.subplot(2, 2, 1)Īdd an overall title to a subplot in matplotlib with the plt.suptitle() function (it stands for ‘super title’). You can add a title to each subplot with the plt.title() function. Now, let’s look at how to add more info to our subplots in matplotib. It’s an easy way to make your plots look great.Ĭheck out the docs more information and arguments that tight_layout in matplotlib accepts. I use plt.tight_layout() in every single plot (without colobars or legends) and I recommend you do as well. Now there is less space between the plots but everything is still readable. It accepts a float in the range and is a fraction of the font size. You can adjust this with the pad keyword. Now there is plenty of space between the plots. Let’s see the most basic example without any labels or titles. Also, note that it does not work too well with legends or colorbars – you’ll see how to work with them later. It’s not perfect but often does a really good job.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |