how to get the RGB number from colorbar
8 ビュー (過去 30 日間)
古いコメントを表示
Hi:
I have a colorbar like below:
![2.jpg](https://www.mathworks.com/matlabcentral/answers/uploaded_files/214761/2.jpeg)
or to simplify this question, I assume the color is from blue (RGB [0,0,1]) to red (RGB [1,0,0]).
is there anyway to get the detail RGB nubmer for each color in this colorbar? in other words, I want to split the colorbar into 1000 parts, is there anyway to got the RGB number of each part?
Thanks!
Yu
0 件のコメント
回答 (1 件)
Adam
2019 年 4 月 18 日
編集済み: Adam
2019 年 4 月 18 日
colourmap = colormap( hAxes );
where hAxes is the axes handle. gca if you really must!
You can then interpolate it to make it bigger or smaller if you wish.
If it is a builtin colourmap though, for example 'Jet', you can just use
colourmap = jet( 1000 );
to get a 1000-element Jet colourmap (not that I am advising using Jet, it was just the one that came to mind and is most similar to the one you show).
参考
カテゴリ
Help Center および File Exchange で Colormaps についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!