how to set color range for color in color bar
54 ビュー (過去 30 日間)
古いコメントを表示
Muhammad Usman Saleem
2015 年 8 月 6 日
コメント済み: Walter Roberson
2015 年 8 月 8 日
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!
