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!