matplotlib中添加公式(⼀些常见的公式)
提供⼀些常见的公式
第⼀部分
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)
<(0.2,0.4,r'$ \sin(\frac{2\pi}{3}) = \frac{\sqrt{3}}{2}$')
<(0.4,0.4,r'$\int_a^b f(x)\mathrm{d}x$')
<(0.2,0.6,r'$ \alpha_i \beta_j \pi \lambda \omega $')
<(0.2,0.8,r'$ y=x^2 $')
<(0.4,0.8,r'$\sigma = \dfrac{1}{1+e^{-x}}$')
<(0.4,0.6,r'f(x)=In(1+e^x)')
<(0.8,0.2,r'$Tanh(x) = \dfrac{sinx}{cosx}=\dfrac{e^x-e^{-x}}{e^x+e^{-x}}$')
<(0.8,0.4,'$\lambda$')
<(0.8,0.6,r'$\Gamma(z) = \int_0^\infty t^{z-1}e^{-t}dt\,.$')
<(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)
<(0.2,0.2,r"$ \mu \alpha \tau \pi \lambda \omega \iota \beta $") (0.2,0.4,r"$ \lim_{x \rightarrow \infty} \frac{1}{x} $")
<(0.2,0.8,r"$ a \leq b \leq c \Rightarrow a \leq c$")
<(0.4,0.2,r"$ \sum_{i=1}^{\infty}\ x_i^3$")
<(0.4,0.4,r"$ \sin(\frac{3\pi}{2}) = \cos(\pi)$")
<(0.4,0.6,r"$ \sqrt[3]{x} = \sqrt{y}$")
<(0.6,0.6,r"$ \neg (a \wedge b) \Leftrightarrow \neg a \ \vee \neg b$") (0.6,0.2,r"$ \int_a^b f(x)dx$")
plt.show()
matplotlib中subplot参考资料
如果要添加中⽂
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论