标签:width pac pre label .com int jpg lib gre
import numpy as np import matplotlib.pyplot as plt x=np.linspace(0,6,100) y=np.cos(2*np.pi*x)*np.exp(-x)+0.8 plt.plot(x,y,‘k‘,color=‘r‘,linewidth=3,linestyle=‘-‘) plt.show()
import matplotlib.pyplot as plt import numpy as np x=np.linspace(0,6,100) y=np.cos(2*np.pi*x)*np.exp(-x)+0.8 plt.plot(x,y,‘k‘,color=‘r‘,label=‘27‘,linewidth=3) plt.axis([0,6,0,1.8]) ix=(x>0.8) & (x<3) plt.fill_between(x,y,0,where=ix,\ facecolor=‘grey‘,alpha=0.25) plt.text(0.5*(0.8+3),0.2,r"$\int_a^b f(x)\mathrm{d}x$",\ horizontalalignment=‘center‘) plt.legend() plt.show()
标签:width pac pre label .com int jpg lib gre
原文地址:https://www.cnblogs.com/luyingqian/p/10710020.html