How to create a custom dynamic colormap?

17 views (last 30 days)
Hi,
I have been wondering about how to create a custom colormap, with a dynamic range similar to the default colormaps in MATLAB. The call to the colorbar will be something like,
customColormap = getCustomColormap(nColors);
It is possible that there is no clear solution to this problems, but it would be great if anyone have an idea to how to proceed.
Best Regards Patrik

Accepted Answer

Simon
Simon on 17 Oct 2013
Hi!
You can use the command "colormap" to create color maps. The built-in colormaps can be scaled dynamically, like
colormap(jet(nColors))
You can as well build your own color maps. A color map is a m-by-3 matrix of real numbers between 0.0 and 1.0, specifying RGB values.
  4 Comments
Patrik Ek
Patrik Ek on 15 Nov 2013
Thank you this colormap editor is amazing. For the automatic rescaling I guess i gets more complicated the more advanced colormap, but thank you for giving me a start.
Giuseppe
Giuseppe on 10 Mar 2017
A small correction:
C_HSV = [C_HSV_interp(:), repmat(C_HSV( 1, 2:3), n, 1)];

Sign in to comment.

More Answers (0)

Categories

Find more on Colormaps in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!