how to set color range for color in color bar
조회 수: 54 (최근 30일)
이전 댓글 표시
In the following color map, i want to set
<0 values set as variation in brightness in deepskyblue 0-79 interval as variation in light green
79-157 interval as variation (you are right variation in brightness) in yellow
above 157 values as variation in brightness from light red to dark red.
I want to show the value above 157 are dark in red color. This is my upper bound.
Also guide me what kind of interpolation technique matlab use to generate raster surface from point data?
Please help??

댓글 수: 0
채택된 답변
Walter Roberson
2015년 8월 6일
Using the color definitions from http://www.rapidtables.com/web/color/blue-color.htm and the color names that you provided:
total_len = 160; %your description did not give an upper bound
part1_len = 79 - 0 + 1;
part2_len = 156 - 80 + 1;
part3_len = total_len - 157 + 1;
%"variations in blue"... ummm, different brightnesses of blue?
map_part1 = [zeros(part1_len,1), zeros(part1_len,1), linspace(128,255,part1_len).'];
%purple = (128,0,128), yellow = (255,255,0)
map_part2 = [linspace(128, 1, part2_len).', linspace(0, 128, part2_len).', linspace(128, 0, part2_len).'];
%red = (255,0,0), dark red = (139, 0, 0)
map_part3 = [linspace(255, 139, part3_len).', zeros(part3_len,1), zeros(part3_len,1)];
%colormaps need to be in the range 0 to 1 so divide by 255
total_map = [map_part1; map_part2; map_part3] ./ 255;
colormap(total_map);
I rather expect that you are going to be disappointed with your color choices.
댓글 수: 12
Walter Roberson
2015년 8월 8일
You need to download and install http://www.mathworks.com/matlabcentral/fileexchange/28943-color-palette-tables---cpt--for-matlab
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Color and Styling에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
