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?

 采纳的回答

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 个评论

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

请先登录,再进行评论。

更多回答(0 个)

类别

在 帮助中心 和 File Exchange 中查找有关 Matrix Indexing 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by