User defined colorbars in a plot
5 ビュー (過去 30 日間)
古いコメントを表示
Hello,
I need a colourbar as shown in the attachment.
Color changes
from light red to red for 1 to 10;
from red to yellow for >10 to 100;
yellow to light green than light blue for 100 to 1000
and ends with dark blue for 2048.
How to achieve this predefined colorbar? Any suitable cmap that can give similar colorbar.
回答 (2 件)
Walter Roberson
2020 年 2 月 4 日
Note that the positions needed there are in the range 0 to 1, so you would need to divide your values by 2048 for this purpose. However, that will not matter for later as you can caxis([1 2048]); colormap(TheCustomMap)
Caution: sufficiently old MS WIndows are restricted to 256 colors in a colormap, but you need 1024 positions (you do not need 2048 positions because each of your bins can be data width 2.) If you could fudge the boundaries to 16 and 128 then you could reduce the number of colormap entries needed.
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!