Python代码返回空白图。如何更正此错误?

2024-09-27 19:23:41 发布

您现在位置:Python中文网/ 问答频道 /正文

身材

x  =  np.linspace(2010,2210,20)


Tline, =  plt.plot(x,T, label="No Taxation",  linewidth=2)
TtaxLine, =  plt.plot(x,T_tax, label= "Ad Valorem", linestyle='--',  linewidth=2)
TunitLine,=  plt.plot(x,T_unit, label="Per  Unit Tax", linewidth=2)
legend= plt.legend(handles=[Tline,  TtaxLine, TunitLine], loc="upper left")
plt.title ('Effect of Taxation on   Mean  Temperature', fontsize=16)
plt.xlabel('Year')
plt.ylabel('Degrees Celsius')
plt.show ()

已生成图形,但图形中没有线条


Tags: no图形plotnppltlabeltaxlegend

热门问题