I won't say much nonsense, everyone should just look at the code!
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
x=np.arange(10)
y=np.sin(x)
plt.figure(figsize=(10,8))
plt.plot(x,y,label=r'$\alpha_v$') #In two$Output between numbers
plt.title(r'$\alpha$')
plt.legend(fontsize=16)
plt.xlabel(r'$\theta_{se}$',fontsize=16) #Subscript use_To indicate that if there are multiple characters in the subscript or superscript, enclose it in curly braces
# plt.xlabel(r'$T$',fontsize=16) #Output italic T
Supplementary knowledge: python-calculate a simple mathematical expression in a paragraph of text
I won't talk too much nonsense, everyone should just look at the code
import re
txt="Please calculate the speed of the old driver within 2s
1678151565-1188787929+1755483937+817954137-442257056-2006451995*2113482706+790747088*888843907+1335150586-33099917=?;"
expression = re.search(r'(\d+[+\-*])+(\d+)', txt).group()
result =eval(expression)print(result)
The above example of python output mathematical symbols is all the content shared by the editor, I hope to give you a reference.
Recommended Posts