English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Puede poner cualquier subconjunto de la cadena de texto de Matplotlib en TeXmarkup entre un par de símbolos de dólar ($)
# Nombre de archivo : example.py # Derechos de autor : 2020 Por w3codebox # Autor por : es.oldtoolbag.com # Fecha : 2020-08-08 # math text plt.title(r'$\alpha > \beta') )
Para crear subíndices y superíndices, utilice los símbolos _ y ^ -
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$', fuente_tamaño=20) plt.text(0.6, 0.6, r'$\mathcal{A}\sin((2 \omega t)$', fuente_tamaño= 20) plt.text(0.1, -0.5, r'$\sqrt{2}$', fuente_tamaño=10) plt.xlabel('tiempo (s)') plt.ylabel('voltios (mV)') plt.show()
Ejecutar el código de ejemplo superior, obtener los siguientes resultados -