https://matplotlib.org/api/index.html#usage-patterns
1、注释
import matplotlib.pyplot as plt
import numpy as np
x=np.arange(-10,11,1)
y=x*x
plt.plot(x,y)
--xy是箭头坐标,xytext是这行字首字母坐标,facecolor是箭头颜色,frac箭头占长度的比例,headwidth最前面头的大小,width是箭身宽度
plt.annotate('this is the bottom',xy=(0,1),xytext=(0,20),
arrowprops=dict(facecolor='r',frac=0.2,headwidth=10,width=10))
plt.show()
2、文字
可在官网查看各种表示
import matplotlib.pyplot as plt
import numpy as np
x=np.arange(-10,11,1)
y=x*x
plt.plot(x,y)
plt.text(-2,40,'function:y=x*x',family='serif',size=20,color='r',style='italic',weight=0)
plt.text(-2,20,'function:y=x*x',family='sans-serif',size=20,color='g',style='oblique',weight='black',bbox=dict(facecolor='r&