Skip to content
Advertisement

How to change the font size on a matplotlib plot

How does one change the font size for all elements (ticks, labels, title) on a matplotlib plot?

I know how to change the tick label sizes, this is done with:

JavaScript

But how does one change the rest?

Advertisement

Answer

From the matplotlib documentation,

JavaScript

This sets the font of all items to the font specified by the kwargs object, font.

Alternatively, you could also use the rcParams update method as suggested in this answer:

JavaScript

or

JavaScript

You can find a full list of available properties on the Customizing matplotlib page.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement