How change the colormap on heatmap??
433 ビュー (過去 30 日間)
古いコメントを表示
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
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/246785/image.png)
Desire
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/246786/image.png)
2 件のコメント
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
2019 年 11 月 5 日
This has been answered many times before. Here's a list of heatmap + colormap related Question-answers.
採用された回答
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
2023 年 3 月 17 日
You can also use the colormap function:
figure
heatmap(magic(5))
colormap(parula)
or
figure
h = heatmap(magic(5))
colormap(h, parula)
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 Center および File Exchange で Colormaps についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!