Consider the following example:
x = linspace(0,3*pi,200);
y = cos(x) + rand(1,200);
c = linspace(1,10,length(x));
figure(); scatter(x,y,[],c);
colorbar
In this example, the color of the data points corresponds to the horizontal coordinate. Instead, I would like color to correspond to the vertical coordinate. How can I achieve this?