How to apply colormapeditor to all subplots?

3 views (last 30 days)
Ronny
Ronny on 7 Oct 2016
Commented: Sophia on 6 Jun 2018
Hi
I have a matlab plot with 3 colormap subplots to which I would like to apply the exact same coloring. I figured out how to do that by applying the same boarder for every plot. However I am not fully satisfied with the jet-style colorbar and would like to make some minor adjustments. To do so I tried to apply the colormapeditor. However the changes I make there will be applied only on the last plot.
Is there a way to postprocess all the plots simultaneously? Or can I somehow set the color of certain values of the axis and the jet axis adjusts automatically?
Cheers Ronny
  2 Comments
Gautam Mohan
Gautam Mohan on 17 Oct 2016
Hi Ronny,
The colormap editor will only change the plot of the most recent axis that was plotted. Subplots contain multiple axes, which is why you are only seeing one plot changed.
The simplest solution you can do to make the change to all plots is to grab the newly-edited colormap from the last axis and apply it to all axes. Here is a short description on how to do that:
colormapeditor; % make desired edits, new colormap shows up on one plot
newColorMap = colormap(gca); % get the new colormap we just created
set(gcf,'ColorMap',newColorMap); % apply the colormap to the parent figure, so it it is reflected on all axes.
Hope this helps!
Sophia
Sophia on 6 Jun 2018
It worked for me..however i don't see the option to accept this as an answer

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!