Following the accepted answer of this thread, I'm trying to use the following MinionPro-Regular
otf font installed on my Windows 10 machine
to set the fonts of all texts and math expressions of my plot to that font as follows.
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
mpl.rcParams['font.family'] = 'MinionPro-Regular'
mpl.rc('text', usetex='true')
mpl.rc('text.latex', preamble=r'\usepackage{bm}')
x = np.arange(0,2*np.pi,0.1)
y = np.sin(x)
fig, ax = plt.subplots()
ax.plot(x,y, label ='Exact')
ax.set_xlabel(r"$\bm{x}$", fontsize=20)
ax.xaxis.label.set_color('red')
ax.set_ylabel(r"$\bm{y}$", fontsize=20)
ax.yaxis.label.set_color('red')
ax.set_title("My title", size=20)
plt.legend()
plt.show()
However, I get the error below:
findfont: Font family ['MinionPro-Regular'] not found. Falling back to DejaVu Sans.
Any idea regarding this problem?
Edit: if I use mpl.rcParams['font.family'] = 'Minion Pro'
, there is no error, however the font is still not Minion Pro like: