Assign mean and max value to a heatmap color bar

25 ビュー (過去 30 日間)
Zeynab Mousavikhamene
Zeynab Mousavikhamene 2020 年 4 月 9 日
編集済み: Mohammad Sami 2020 年 4 月 9 日
In order to be have consistant colorbar for all plots, how can I set a min and max to the heatmap color bar? I want to customize the min and max
The line of code I am using now is:
h = heatmap(x,y,mat,...
'ColorScaling','log','MissingDataColor','1.00,1.00,1.00','GridVisible','off','MissingDataLabel','');
colormap(flipud(colormap('summer'))); set(gca,'FontSize',14,'FontName','Arial');
thank you

採用された回答

Mohammad Sami
Mohammad Sami 2020 年 4 月 9 日
You can specify the color limits in your heat map
%h = heatmap(__,'ColorLimits',[0 10])
  2 件のコメント
Zeynab Mousavikhamene
Zeynab Mousavikhamene 2020 年 4 月 9 日
Thanks.Tired that but did not give me reasonable ouput.
The color bar before:
and after:
I used this code:
% h = heatmap(__,'ColorLimits',[0 1])
Mohammad Sami
Mohammad Sami 2020 年 4 月 9 日
編集済み: Mohammad Sami 2020 年 4 月 9 日
This is arising from setting colorscaling to log. you may wish to omit that or specify the color limits in log scale as.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Distribution Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by