I am trying to get a simple Greek letter mu to display in Roman font in a saved shape with matplotlib. I tried two methods:
plt.xlabel(u'Wavelength (\u03bc m)')
This method works fine when I do show() , but when I try to use savefig() , the mu character is displayed as a rectangle when saved as .png. If I save as .pdf, the character is completely missing.
plt.xlabel(r'Wavelength ($\mathrm{\mu}$m)')
This method displays the Greek letter with both show() and savefig() , but the character is still italicized in each case, despite the Roman font request.
What trick?
source share