how to set color range for color in color bar
7 次查看(过去 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 中查找有关 Blue 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!