I have a list of points (r1,r2) which I am plotting. For these points I have a certain error value 's' associated with each one of them. I want to assign a color with respect to what the error for each point is. For example red for highest error and blue for lowest error and also get a legend showing the range of colors. Can it be done? I have the following piece of code that I am trying:
fig, ax = plt.subplots()
data = scatter(r1, r2, c=s)
ax.set_title('Colormap for errors')