The following is an extension of a previous question. Am I wrong to assume that only some utf-8 characters are supported in matplotlib, at least with DejaVu Sans
as suggested here, but not others? Specifically, the ballot x mark does not render, nor does the regular checkmark if I do not use the special mathtext syntax.
# -*- coding: utf-8 -*-
%pylab inline
import numpy as np
from matplotlib import rcParams
import matplotlib.pyplot as plt
t = np.arange(0.0, 2.0, 0.01)
s = np.sin(2*np.pi*t)
rcParams['font.family'] = 'sans-serif'
rcParams['font.sans-serif'] = ['DejaVu Sans']
plt.plot(t,s)
plt.text(1, -0.4, ur'$\u2718$', fontsize=20) # ballot x mark with mathtext
plt.text(1, -0.6, u'\u2713', fontsize=20) # check mark
plt.text(1, -0.8, ur'$\u2713$', fontsize=20) # check mark with mathtext
plt.xlabel(u'technologie\u00ebn in \u00b0C \u2713') # check mark after degrees C
plt.ylabel('volts (mV)')
plt.show()
yields