Changing colorscale increments on a surface plot
Show older comments
I've got some data which ranges from 1 to around 1E-06 which I am plotting using the mesh function. I'm using the jet colormap which is fine but the color scales goes from 1 to 0.1 in steps of 0.1 and I want it go from 1 to 1E-09 or so in increments of one order of magnitude. i.e. colorscale goes, 1, 0.1, 0.01, 0.001, 1E-04 etc. This will give a broad range of color data and should be fairly intuitive to interpret, currently my surface is nearly all blue as it is not scaling the color.
Some googling suggesting using the set command, but I've not had any success.
I tried:
mesh(X,Y,Z) view(2)
aa = colorbar;
get(aa,'Ytick');
%This returns a vector of [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1]
%So then if we create a vector tt, with the desired YTick
tt = [1e-10,1e-09,1e-08,1e-07,1e-06,1e-05,1e-04,1e-03,1e-02,1e-01,1]
set(aa,'Ytick',tt);
But this doesn't appear to do anything, the colors on the graph stay the same. Any help which could set me on the right track would be greatly appreciated.
Thanks in advance Rob
Accepted Answer
More Answers (1)
Image Analyst
on 23 Sep 2014
You can get up to 256 colors in a colormap
colormap(jet(256));
the default, which you're probably seeing is only 64.
3 Comments
Rob
on 24 Sep 2014
Image Analyst
on 24 Sep 2014
Not exactly sure what that means, but have you checked out the caxis() function?
Thomas Carter
on 15 Jun 2021
I like this one, just needed more color on scale.
Categories
Find more on Color and Styling in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!