注释
import numpy as np
import matplotlib.pyplot as plt
x = np.arange(-10,11,1)
y = x*x
plt.plot(x,y)
plt.annotate('this is the bottom',xy = (0,3),xytext = (0,30),
arrowprops = dict(facecolor = 'r',frac = 0.2,headwidth = 10,width = 10))
plt.show()
文字
import numpy as np
import matplotlib.pyplot as plt
x = np.arange(-10,11,1)
y = x*x
plt.plot(x,y)
#位置,文字内容,字体,字体大小,字体颜色,字体为粗体还是斜体,字体线条粗细,文本框底色,底色透明度
plt.text(-2,40,'function:y = x*x',family = 'serif',size = 10,color = 'r',style = 'italic',weight = 'black')
plt.text(-2,20,'function:y = x*x',family = 'fantasy',size= 10,color = 'g',style = 'normal',weight = 50,bbox = dict(facecolor = 'r',alpha = 0.2))
plt.show()
Tex公式(画数学公式)
作 为 开 始 和 结 束 符 , 如 " 作为开始和结束符,如" 作为开始和