Write \mu (Greek letter, Symbol) in Python Matplotlib.pyplot


The results are:
Write \mu (Greek letter, Symbol) in Python Matplotlib.pyplot times
Write \mu (Greek letter, Symbol) in Python Matplotlib.pyplot arial

This page shows how to write μ:mu, \mu in the matplotlib. By specifying the Unicode, you can add arbitrary character to the plot.

In [1]:
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
In [2]:
plt.rcParams["font.size"] = 12
In [3]:
# the font which has "\u03bc" properly output the mu character
plt.rcParams["font.family"] = "Times New Roman"
plt.figure(figsize=(3,2.5))
plt.xlabel(u"\u03bcs")
plt.ylabel(u"\u03bcA")
plt.savefig("mu_times.png",dpi=200,bbox_inches="tight")
plt.show()
In [4]:
plt.rcParams["font.family"] = "Arial"
plt.figure(figsize=(3,2.5))
plt.xlabel(u"\u03bcs")
plt.ylabel(u"\u03bcA")
plt.savefig("mu_arial.png",dpi=200,bbox_inches="tight")
plt.show()