0

I need to change the appearacnce (font/size) of the units in axis label. below is an example of the plot, so, I wanna to change the appearance of unit(e.g. m/c*g/cc)

#
plt.subplot2grid((2,3), (1,0), colspan=1, rowspan=1)
s  = plt.scatter(Ip , Is , c=time , s=10, cmap='tab10', 
                 norm=mpl.colors.SymLogNorm(linthresh=10),marker = 's')
plt.xlabel(r'$I_p(m/s*g/cc)$')
plt.ylabel(r'$I_sI_p(m/s*g/cc)$')

Thanks

Dr. Zezo
  • 395
  • 2
  • 17
  • Possible duplicate https://stackoverflow.com/questions/6390393/matplotlib-make-tick-labels-font-size-smaller – bigbounty Jul 06 '20 at 10:35

1 Answers1

0

From the MatPlotLib documentation, this is suggested:

import matplotlib.pyplot as plt

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

plt.xlabel('font', **font)
plt.ylabel('font', **font)
Gavin Wong
  • 1,254
  • 1
  • 6
  • 15