How to set fonts of labels? Everything in graph is plotted with Latin Modern Roman, but labels not. I tried csfont, but it didn't help.
import matplotlib.pyplot as plt
from matplotlib.font_manager import FontProperties
plt.rcParams["font.family"] = "Latin Modern Roman"
csfont = {'fontname':'Latin Modern Roman'}
plt.xlabel(r'$\it{Label2}$', fontsize=14)
plt.ylabel(r'$\it{Label1}$ (eV)', fontsize=14, **csfont)
I tried this for ylabel:
plt.ylabel(r'$\it{Excitační energie}$ (eV)', family='Latin Modern Roman', fontsize=14)
and this is result: