【发布时间】:2021-09-22 05:35:48
【问题描述】:
我已经使用 csv 数据绘制了线图并将 matplotlib.pyplot 作为 plt 导入 费用、总计和年份已按行追加。
我的代码
plt.plot(year, charge, '-g', label = 'Chargeable Income')
plt.plot(year, total, '-r', label = 'Total Income')
plt.title('Chargeable and Total Income VS Year')
plt.xlabel('Year')
plt.ylabel('(S$)')
plt.grid()
plt.legend()
plt.show()
这是当前线图的样子:
【问题讨论】: