I want to display the D-stroke symbol (\DJ) using the following code, but I failed. Could anyone tell me how to make it correct?
As shown in the figure, the symbol $\mu$ works well but the $\DJ$ symbol doesn't appear.
Any advice and suggestions will be greatly appreciated!
import matplotlib as mpl
mpl.use("pgf")
pgf_with_custom_preamble = {
"text.usetex": True, # use inline math for ticks
"pgf.rcfonts": False, # don't setup fonts from rc parameters
"pgf.preamble": [
'\\usepackage[utf8]{inputenc}'
'\\usepackage[T1]{fontenc}'
'\\usepackage{tgtermes}'
]
}
mpl.rcParams.update(pgf_with_custom_preamble)
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
x = [1,2,3,4,5]
y = [10, 20, 30, 40, 50]
plt.plot(x,y)
plt.xlabel('$\mu$')
plt.title('$\DJ$')
