I am trying to add the y=x line along with an offset from the y=x line a better way than the code I shared. For example, with Y=X, i want two additional diagonal lines +0.5 and -0.5 from the Y=X but the code I show is a bit harder to understand. Any help with this would be appreciated.
x=np.linspace(0,5,101)
y=np.random.normal(x) # add some noise
plt.plot(x,y,'r.') # x vs y
plt.plot(x,x,'k-') # identity line
plt.plot(x+0.25,x-0.25,'b-') # identity line
plt.plot(x-0.25,x+0.25,'b-') # identity line
plt.xlim(0,5)
plt.ylim(0,5)
plt.show()