DEV Community

Nilotpal Choudhury
Nilotpal Choudhury

Posted on

Answer: How to change the font size on a matplotlib plot

From the matplotlib documentation,

font = {'family' : 'normal',
        'weight' : 'bold',
        'size'   : 22}

matplotlib.rc('font', **font)

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:

Top comments (0)