How to change the size of axis labels in Matplotlib?
Matplotlib is a great data plotting tool. It’s used for visualizing data and also for presenting the data to your team on a presentation or for yourself for future reference. So, while presenting it might happen that the “X-label” and “y-label” are not that visible and for that reason, we might want to change its font size. So in this article, we are going to see how we can change the size of axis labels in Matplotlib.
Before starting let’s draw a simple plot with matplotlib.
Now we will see how to change the size of the axis labels:
Example 1: Changing both axis label.
If we want to change the font size of the axis labels, we can use the parameter “fontsize” and set it your desired number.
Example 2: Changing the y-axis label.
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course