说明:1、打印特殊符号
matplotlib在公式书写上面跟latex很相似,接下来我们就特殊符号,上标下标来具体展示一下。
import matplotlib.pyplot as plt
x = [i+1 for i in range(20)]
y = x
plt.figure()
plt.title(r'$\alpha$ > $\beta$') # 打印α>β
plt.xlabel(r'$\theta$') # 打印θ
plt.ylabel(r'$\omega$') # 打印ω
pl <weixin_38595689> 上传 | 大小:157kb
说明:我就废话不多说了,还是直接看代码吧!
def restart_program():
"""Restarts the current program.
Note: this function does not return. Any cleanup action (like
saving data) must be done before calling this function."""
python = sys.executable
os.execl(python, py <weixin_38631599> 上传 | 大小:54kb