How to create a custom color spectrum from an array...?
2 ビュー (過去 30 日間)
古いコメントを表示
I have an array that is something like this: x = [1000,1200,1300,1250,1340,1020,...]
It goes to about 600 "columns."
Now if I want to take those numbers and turn them into a color spectrum, how do I go about doing that...? I have considered doing it manually and actually write out an if/else statement where it goes through each element and finds out what "bin" that it corresponds to and then assign a color.
Then when putting it together, it will create a "color spectrum". But in my case I just want a visual image of the array which looks like a color spectrum.
I was hoping to avoid that if possible. So is there a shortcut to do what I need without having to brute force it...?
Thanks in advance.
0 件のコメント
回答 (1 件)
bym
2011 年 9 月 19 日
you can customize a colormap to your data, for example:
jet(600);
would produce the color map 'jet' to map your array to a unique color
doc colormap
don't know if this is what you are looking for
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!