How to use two colormaps for different levels of my signal in contour plot?

1 view (last 30 days)
Hi all, I would like to make something different from How do I plot multiple colormaps in a single? ,using two colormaps. I have some data to plot in a contour plot with huge level difference. I could omit the high levels and only plot the low ones. But I think that if I can use different colormaps the result will be more intuitive.
So my scope is to use two different colormaps. The first one will be associated to the low levels of my signal (e.g 0<x<100) and the second one to the high ones (101<x<10^4).
Is there any way to accomplish that?
Thank you in advance.
Giannis.

Answers (1)

Stephen23
Stephen23 on 13 May 2016
Edited: Stephen23 on 13 May 2016
With contour there is no such thing as CData as there is for surf and the like, so the colors are simply mapped/scaled to the Z values. If you have such are huge range of data, then here are some options:
  1. plot the log of your data. This may make understanding the data much simpler anyway, as the shape may then also have more meaning.
  2. Define a colormap using the colormapeditor.
  3. Use my FEX submission CubeHelix to generate a colormap. You can use the function cubehelix_view to adjust the parameters: you will find the gamma value can be used to add skew to the map, which may provide the effect that you are looking for.
  4. Concatenate two together (use vertcat). You will need to either match the size of the conjoined colormap to the required size, or use some interpolation to match the image/figure.

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!