The file of the font library is in .tff
format
The windows pc terminal basically reaches the various fonts we need
First you need to find out where it is:
C:\Windows\Fonts
Take my most commonly used Aria font as an example, double click to enter
there will be the following files
Then call the Arial regular file as an example, upload this .tff
file to the server (I plot diagrams on the terminal)
from matplotlib.font_manager import FontProperties
font = FontProperties(fname='/home/wangnan/arial.ttf')
a=np.linspace(1,6)
plt.plot(a,a)
plt.tick_params(labelsize=18)
plt.xlabel('My Label', FontProperties=font,size=22)
plt.yticks(FontProperties=font, size = 16) #xy-axis scale numbers
plt.xticks(FontProperties=font, size = 16)
If you want to change the font of the colorbar scale, you can define another tick to cover it.
cb1=plt.colorbar(c1,ticks=np.arange(-30,35,10),cax=position)
cb1.set_label(r'$\mathrm{\Delta O_{3}\_CHEM\ by\ BVOCs\ (ppb)}$', FontProperties=font,size=18)
#This step is very important
cb1.ax.set_yticklabels(np.arange(-30,35,10),FontProperties=font,size=16)