Changing colorscale increments on a surface plot
이전 댓글 표시
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
채택된 답변
추가 답변 (1개)
Image Analyst
2014년 9월 23일
You can get up to 256 colors in a colormap
colormap(jet(256));
the default, which you're probably seeing is only 64.
댓글 수: 3
Rob
2014년 9월 24일
Image Analyst
2014년 9월 24일
Not exactly sure what that means, but have you checked out the caxis() function?
Thomas Carter
2021년 6월 15일
I like this one, just needed more color on scale.
카테고리
도움말 센터 및 File Exchange에서 Color and Styling에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!