【发布时间】:2018-06-16 11:49:42
【问题描述】:
我从 dataFrame 绘制的数据看起来像这样 Image 现在我需要添加一条适合现有图的回归线。
添加回归线最简单的方法是什么?
使用的代码是这样的:
df2 = myReport.loc[:, ['Quantity']]
print(df2)
plt.plot(df2, linestyle="", marker="." )
plt.axis([0,45,5023203,5938119])
plt.grid(True)
plt.legend(df2.columns)
plt.ylabel ('Population')
plt.xlabel ('Timeline')
plt.show()
使用 python 2.7 版。
【问题讨论】:
标签: python plot regression