import matplotlib.pyplot as plt
Use fontprops with various entities
Declare fontprops:
import matplotlib as mpl
= mpl.font_manager.FontProperties(
custom_font ='Verdana', style='italic', size=14
family )
'Something interesting here',
ax.annotate(= (0.5,0.5), xycoords=ax,
xy =custom_font,)
fontproperties
'Nice title',
f.suptitle(=custom_font, )
fontproperties
for tick in ax.get_yticklabels():
tick.set_font_properties(custom_font)
=handles, prop=custom_font) ax.legend(handles
Use local ttf file as fontprops
from pathlib import Path
= mpl.font_manager.FontProperties(
title_font =Path("./Barlow/Barlow-Bold.ttf"), size=20) fname