黑色和红色图表的图例未显示
years = [1950, 1960, 1970, 1980, 1990, 2000, 2010]
gdp = [300.2, 543.3, 1075.9, 2862.5, 5979.6, 10289.7, 14958.3]
gdp_half = [150.1, 271.66, 538, 1431.3, 2989.8, 5144.9, 7479.1]
plt.plot(years, gdp, color='k' ,linestyle = 'dashed', marker = 'o', label = 'one')
[<matplotlib.lines.Line2D object at 0x04835C70>]
plt.plot(years, gdp_half, color='r' ,linestyle = 'dashed', marker = 'o', label = 'two')
[<matplotlib.lines.Line2D object at 0x04835550>]
plt.show()