import matplotlib.pyplot as pltx=[1,2,3,4,5,6]y1=[35000,85000,120000]y2=[45000,85000,100000]y3=[25000,65000,90000]point1=180180point2=200000plt.rcParams['font.sans-serif'] = ['SimHei'] #用来正常显示中文标签 plt.rcParams['axes.unicode_minus'] = False #用来正常显示负号plt.scatter(x[5],point1,marker='o')plt.scatter(x[5],point2,marker='o')plt.plot(x[:3],y1,label='计划值PV',linewidth = 2)plt.plot(x[:3],y2,'g--',label='挣值EV',linewidth = 2)plt.plot(x[:3],y3,'r-.',label='实际成本AC',linewidth = 2)plt.ylabel('美元')plt.xlabel('月')plt.annotate('EAC:%d'%point1, xy = (6, point1), xytext=(5.5*0.9, point1*0.9), arrowprops=dict(arrowstyle="->", connectionstyle="arc3,rad=.2")) #添加注释,即85%处的标记。这里包括了指定箭头样式。plt.annotate('BAC:%d'%point2, xy = (6, point2), xytext=(5*0.9, point2*0.9), arrowprops=dict(arrowstyle="->", connectionstyle="arc3,rad=.2")) #添加注释,即85%处的标记。这里包括了指定箭头样式plt.title('项目3个月后的挣值示意图')plt.legend()plt.show()