I'm trying to generate a scatter plot in matlab with a colorbar with minimum values colored in blue and the maximum in red. I can do this with the redblue colomap from the file exchange (e.g. http://www.mathworks.com/matlabcentral/fileexchange/25536-red-blue-colormap)
Here's an example:
dd = [70.7 140.0 902.0
70.2 138.6 765.0
68.4 141.2 645.0
67.8 133.2 735.0
64.9 137.7 398.0
63.8 145.1 583.0
74.6 126.6 1880.0
82.8 124.3 -71.0
91.8 124.7 1315.0
93.1 119.6 400.0
95.7 117.0 326.0
104.3 121.3 179.0
104.4 122.0 205.0
104.4 122.3 181.0
104.6 113.0 265.0
109.8 118.2 170.0
55.0 149.6 913.0];
scatter(dd(:,1),dd(:,2),80,dd(:,3),'filled');
box on;
colormap(redblue);
c = colorbar;
I would like to alter the colorbar so that the white region refers to zero. this can be done by altering the caxis to:
caxis([-1800 1800]);
But this doesn't make sense in this example because the majority of the points are above 0. Therefore, I was hoping to find a way of having the colorbar from -200 to 1800 but with the white in the colorbar stillbeing as zero. Is this possible?