Last active
May 10, 2022 00:59
-
-
Save aunyks/26cd02d98c52f73370902989432e40cb to your computer and use it in GitHub Desktop.
A Python program for generating LaTeX expressions.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
import sympy | |
limxtoinf = sympy.Symbol('\lim_{x\\to\infty}') | |
# THE LATEX EXPRESSION TO BE PRINTED | |
expr = sympy.latex(limxtoinf) | |
# OR | |
#expr = '\lim_{x\\to\infty}' | |
#add text | |
plt.text(0.2, 0.7, r"$%s$" % expr, fontsize = 50) | |
#hide axes | |
fig = plt.gca() | |
fig.axes.get_xaxis().set_visible(False) | |
fig.axes.get_yaxis().set_visible(False) | |
plt.draw() #or savefig | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment