Manually picking colours from a Matlab colourmap

Hi!
Is there a way to get access to a Matlab colourmap (e.g. 'Hot') as an array of distinct colours? I know I can readily use the colourmaps i plots such as surf. To reiterate, what I want is to be able to pick the colours manually from the colourmap using something like array indices.
Any suggestions?

 Accepted Answer

When you write
colormap(hot);
colormap calls the function hot to ask it to return the array of rgb colours to use. You can do the same yourself:
cmap = hot(); %optional you can specify how many colours to use.
For some reasons hot, jet, summer etc. are not documented properly (no entry in the documentation), but you can still get their help with
help hot
help jet
help summer
...

1 Comment

Thanks you very much for your prompt reply! I was indeed confused by the lack of documentation.

Sign in to comment.

More Answers (0)

Tags

Asked:

on 1 Jul 2016

Commented:

on 1 Jul 2016

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!