记录的散点图,具有回归和标准偏差

时间:2020-10-31 16:48:35

标签: matplotlib plot regression standards standard-deviation

如何绘制带有回归线和围绕回归线的标准偏差的已记录散点图?即使在对小数位设置了限制之后,该行似乎也根本没有出现。

plt.style.use('ggplot')

x = np.log(ld_country["confirmed"])
y = np.log(ld_country["deaths"])
a = np.log(ld_country.loc['Singapore','confirmed'])
b = np.log(ld_country.loc['Singapore','deaths'])
b, m = polyfit(x, y, 1)

plt.plot(x, y, '.',c='red')
plt.scatter(x,y,c='red')
plt.scatter(a,b,s=200,marker='*',c='blue')
plt.legend(["Rest of the World","Singapore"])
plt.title("Mortality Rate (Logged)")
plt.xlabel("Log Total Cases")
plt.ylabel("Log Total Deaths")

0 个答案:

没有答案