I want to change the font size for matplotlib

Asked 2 years ago, Updated 2 years ago, 69 views

I don't know how to change the font size for labels or titles in matplotlib plot

How do you change the tick label?

import matplotlib 
matplotlib.rc('xtick', labelsize=20) 
matplotlib.rc('ytick', labelsize=20) 

matplotlib python

2022-09-22 13:18

1 Answers

According to matplotlib.rc(group, **kwargs)

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

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

Or

matplotlib.rcParams.update({'font.size': 22})

You can write.


2022-09-22 13:18

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.