【发布时间】:2021-12-16 22:34:17
【问题描述】:
我已经使用 python 绘制了数据。以下是代码的摘录:
#matplotlib
ax = df.plot.scatter(x = 'exp_CO', y = 'sim_CO',s=30, color='g' )
#plot the line of correlation:x=y
lims = [
np.min([ax.get_xlim(), ax.get_ylim()]), # min of both axes
np.max([ax.get_xlim(), ax.get_ylim()]), # max of both axes
]
# now plot both limits against eachother
ax.plot(lims, lims, 'k-', alpha=0.75, zorder=0)
ax.set_aspect('equal')
ax.set_xlim(lims)
ax.set_ylim(lims)
plt.title('experimental $^{13}{CO}$ chemical shift (ppm) vs simulated $^{13}{CO}$ chemical shift (ppm)')
plt.xlabel('exp_CO',weight='semibold', size = 20)
plt.ylabel('sim_CO',weight='semibold', size = 20)
plt.show()
现在我想在 x=y 线的下方和上方绘制一条线,这基本上表示该线上方和下方的误差为 2.45。 这就是绘图应该看起来像这样,上面和下面的粉色线到中间线的距离应该覆盖 2.45:
我如何绘制这个?任何帮助表示赞赏。提前致谢。
【问题讨论】: