English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Você pode colocar subconjuntos de strings de texto do Matplotlib em TeX markup entre pares de sinais de dólar ($).
# Nome do arquivo : example.py # Copyright : 2020 Por w3codebox # Autor por: pt.oldtoolbag.com # Data : 2020-08-08 # math text plt.title(r'$\alpha > \beta$) )
Para criar subíndices e superíndices, use os símbolos _ e ^ -
r'$\alpha_i> \beta_i$' 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(0.6, 0.6, r'$\mathcal{A}\mathrm{sin}(2 \omega t)$', fontsize= 20) plt.text(0.1, -0.5, r'$\sqrt{2}$', fontsize=10) plt.xlabel('tempo (s)') plt.ylabel('volts (mV)') plt.show()
Executar o código de exemplo acima, obter os seguintes resultados -