Figure not updating with new colormap

조회 수: 6 (최근 30일)
Edward Byers
Edward Byers 2016년 3월 23일
댓글: Alexei M 2020년 5월 8일
Hi
I have recently updated from 2012 edition to R2015a. The trouble I am having is that I am not managing to update the colormap. It seems that the colours are frozen?
Previously I would have expected this to work:
figure
plot(Demand.Prd_Mth_U) %Data struct with multiple arrays
colormap(jet) % This could be above plot also
With the colormap applying to the current axes/figure. But it doesn't seem to change. I know that the colormap values are changing because when I call "colormap", it shows different values depending on whether I have set it to jet, hsv, cool, etc.
Even when I open the colormapeditor, via command line or Figure Edit menu, the desired colormap is there already (as opposed to showing the map that's in the figure). When I click apply, nothing.
Also, if I have the colorbar in the figure - that changes as expected....
This is an output:
figure
colormap(hsv)
colorbar
plot(Demand.Prd_Mth_50)
Lastly, when I tried to change the color of an individual line, the color changes as expected, e.g.: set(po(1),'color',[0 1 0]) % where po is the handle...
Thanks!

채택된 답변

Mike Garrity
Mike Garrity 2016년 3월 23일
You don't have anything in that figure that uses the colormap. The plot function uses the ColorOrder property on the axes. The colormap is used by things like surface and image.
  댓글 수: 3
Francisco de Castro
Francisco de Castro 2018년 3월 16일
A related question: if this is the case, why did it work in previous versions? Like Edward said, changing the colormap used to affect the output of plot, didn't it?
Alexei M
Alexei M 2020년 5월 8일
Hi Mike,
I have a similar problem. I have a figure which I thought is a surface plot. It also has a color bar but when I change colormap only the bar changes while the main figure is unaffected. This is actually an output from a COMSOL model. How do I change the colormap of the main figure? And how can I determine what "type" of thing is inside the axes? You say that only certain things use colormaps, so how can I determine the exact nature of the thing that I'm looking at? I didn't make it. The figure was given to me by a collaborator, and I'm trying to edit it.

댓글을 달려면 로그인하십시오.

추가 답변 (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