dimanche 3 juillet 2016

Matplotlib math mode not displayed correctly

I am trying out this example in Python 3.4.4 using Matplotlib version 1.5.1 on Windows 10:

import numpy as np
import matplotlib.pyplot as plt
t = np.arange(0.0, 2.0, 0.01)
s = np.sin(2*np.pi*t)

plt.plot(t,s)
plt.title(r'$alpha_i > beta_i$', fontsize=20)
plt.text(1, -0.6, r'$sum_{i=0}^infty x_i$', fontsize=20)
plt.text(0.6, 0.6, r'$mathcal{A}mathrm{sin}(2 omega t)$',
         fontsize=20)
plt.xlabel('time (s)')
plt.ylabel('volts (mV)')
plt.show()

(see http://matplotlib.org/users/mathtext.html). It produces the following result:

enter image description here

What should I do to produce the intended result (see below)?

enter image description here

Aucun commentaire:

Enregistrer un commentaire