필터 지우기
필터 지우기

How change the colormap on heatmap??

조회 수: 433 (최근 30일)
Yuliano Moscoso Yarin
Yuliano Moscoso Yarin 2019년 11월 5일
댓글: Steven Lord 2023년 3월 17일
Hello ,
I'm trying to change the colormap on my heatmap, I'm using right now the '"money" color but I'm want to be blue one, I tried many options without any luck. Any help will be appreciate.
Thanks.
Original
Desire
  댓글 수: 2
Jess Lovering
Jess Lovering 2019년 11월 5일
편집: Jess Lovering 2019년 11월 5일
Here is a helpful resource for this question. You can make and save any colormap you want throught the colormap editor:
Adam Danz
Adam Danz 2019년 11월 5일
This has been answered many times before. Here's a list of heatmap + colormap related Question-answers.

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

채택된 답변

Steven Lord
Steven Lord 2019년 11월 5일
Change the Colormap property of the heatmap, either when you construct the heatmap:
h = heatmap(magic(5), 'Colormap', copper);
or afterwards.
h.Colormap = flag;
If none of the predefined colormaps are suitable for your application you can build your own as an M-by-3 matrix, either manually or using the colormapeditor as per Jessica Lovering's comment.
h.Colormap = repmat(linspace(0, 1, 25).', 1, 3);
  댓글 수: 2
Benjamin Kraus
Benjamin Kraus 2023년 3월 17일
You can also use the colormap function:
figure
heatmap(magic(5))
colormap(parula)
or
figure
h = heatmap(magic(5))
h =
HeatmapChart with properties: XData: {5×1 cell} YData: {5×1 cell} ColorData: [5×5 double] Show all properties
colormap(h, parula)
Steven Lord
Steven Lord 2023년 3월 17일
There's also a new colormap named sky introduced in release R2023a that may be of interest if you want a colormap from white or very light blue through dark blue.
heatmap(magic(4))
colormap(sky)

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

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