How to create a custom color spectrum from an array...?
2 views (last 30 days)
Show older comments
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 Comments
Answers (1)
bym
on 19 Sep 2011
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 Comments
See Also
Categories
Find more on Blue in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!