I have recently (i.e., yesterday) discovered matplotlib as a much better alternative to Matlab for plots. Unfortunately, my knowledge of python is close to zero.
I would like to use \mathbb{} in the legend and/or axes (for example, to denote expected value or variance) and it seems that this requires the additional STIX fonts (see, e.g., here and here). However, I haven't been able to include these fonts in my code so far.
In the following example, I would like to replace \mathrm{E} --> \mathbb{E} and \mathrm{V} --> \mathbb{V}. Is there a simple way to do it?
import numpy as np
import scipy.io
from matplotlib import pyplot as plt
plt.figure(figsize=[3.3, 3.3])
plt.rcParams.update({'font.size': 8, 'text.usetex': True})
plt.plot([1,2,3,4], [1,2,3,4], label=r'$\mathrm{E}[x]$')
plt.plot([1,2,3,4], [1,4,9,16], label=r'$\mathrm{V}[x]$')
plt.grid()
plt.xlabel('x')
plt.legend(loc='upper left')
plt.savefig('filename.pdf', format='pdf')
plt.show()
