How to apply colormapeditor to all subplots?

3 次查看(过去 30 天)
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 个评论
Gautam Mohan
Gautam Mohan 2016-10-17
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 2018-6-6
It worked for me..however i don't see the option to accept this as an answer

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Colormaps 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by