提供一些常见的公式
第一部分
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
fig = plt.figure(dpi=500)
# fig, axes=plt.subplots(1,1)
axes=fig.add_subplot(1,1,1)
axes.text(0.2,0.4,r'$ \sin(\frac{2\pi}{3}) = \frac{\sqrt{3}}{2}$')
axes.text(0.4,0.4,r'$\int_a^b f(x)\mathrm{d}x$')
axes.text(0.2,0.6,r'$ \alpha_i \beta_j \pi \lambda \omega $')
axes.text(0.2,0.8,r'$ y=x^2 $')
axes.text(0.4,0.8,r'$\sigma = \dfrac{1}{1+e^{-x}}$')
axes.text(0.4,0.6,r'f(x)=In(1+e^x)')
axes.text(0.8,0.2,r'$Tanh(x) = \dfrac{sinx}{cosx}=\dfrac{e^x-e^{-x}}{e^x+e^{-x}}$')
axes.text(0.8,0.4,'$\lambda$')
axes.text(0.8,0.6,r'$\Gamma(z) = \int_0^\infty t^{z-1}e^{-t}dt\,.$')
axes.text(0.8,0.8,r' $\Gamma(n) = (n-1)!$'
)
plt.show()
第二部分
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
fig = plt.figure(dpi=500)
axes=fig.add_subplot(1,1,1)
axes.text(0.2, 0.2, r"$ \mu \alpha \tau \pi \lambda \omega \iota \beta $")
axes.text(0.2, 0.4, r"$ \lim_{x \rightarrow \infty} \frac{1}{x} $")
axes.text(0.2, 0.8, r"$ a \leq b \leq c \Rightarrow a \leq c$")
axes.text(0.4, 0.2, r"$ \sum_{i=1}^{\infty}\ x_i^3$")
axes.text(0.4, 0.4, r"$ \sin(\frac{3\pi}{2}) = \cos(\pi)$")
axes.text(0.4, 0.6, r"$ \sqrt[3]{x} = \sqrt{y}$")
axes.text(0.6, 0.6, r"$ \neg (a \wedge b) \Leftrightarrow \neg a \ \vee \neg b$")
axes.text(0.6, 0.2, r"$ \int_a^b f(x)dx$")
plt.show()
参考资料这里
如果要添加中文
plt.rcParams['font.sans-serif'] = ['SimHei'] # 替换sans-serif字体
plt.rcParams['axes.unicode_minus'] = False # 解决坐标轴负数的负号显示问题