Change the font size of Matplotlib legend

To increase or decrease the font size of legends in a graph, use the fontsize parameter of the legend() method. The value of the fontsize can be:

  • xx-small
  • x-small
  • small
  • medium
  • large
  • x-large
  • xx-large

Let us see an example to set the font size of legends in Matplotlib. We will increase the size of the legend, wherein Frequency and Periods are set:

Output

Change the font size of Matplotlib legend


If you liked the tutorial, spread the word and share the link and our website Studyopedia with others.


For Videos, Join Our YouTube Channel: Join Now


Change the background color of the Matplotlib legend
Matplotlib - Line Graph
Studyopedia Editorial Staff
contact@studyopedia.com

We work to create programming tutorials for all.

No Comments

Post A Comment

Discover more from Studyopedia

Subscribe now to keep reading and get access to the full archive.

Continue reading