Matlab colormap/colorbar range

  • MATLAB
  • Thread starter darkfall13
  • Start date
  • #1
33
0
I'm doing some plotting in Matlab where I'm using a third variable of data as a color. For example I have vectors x and y with some sort of values plotted as a scatter plot. I can color the points according to a third vector z by turning on colormap and colorbar (scatter(X,Y,S,C) and use z in place of C) and Matlab will take care of the color range and scaling.

But let's say z contains random values ranging from -25 to 25 then of course the ends of the colormap will be -25 and 25, but what if you want it to just end at say -10 and 10 so that all values outside of that range are the last color of the colormap?
 

Answers and Replies

  • #2
33
0
I think I found it, using "caxis([minvalue maxvalue])" before colorbar seems to be what I'm looking for.
 

Related Threads on Matlab colormap/colorbar range

Replies
1
Views
847
Replies
1
Views
4K
  • Last Post
Replies
5
Views
2K
  • Last Post
Replies
3
Views
3K
  • Last Post
Replies
2
Views
3K
  • Last Post
Replies
1
Views
2K
  • Last Post
Replies
3
Views
1K
  • Last Post
Replies
2
Views
6K
Top