how can i add the numers on the heatmap?

8 ビュー (過去 30 日間)
myrto pieridou
myrto pieridou 2022 年 7 月 8 日
コメント済み: myrto pieridou 2022 年 7 月 18 日
cdata=[1.6 1.6 1.6,1.6,1.6 1.6 1.6 1.6 1.1 1.1 1.1 1.3 1.3 1.3 4.5 1.6 1.6 1.6 1.6 1.6 1.6 1.6 2.3 2.3 1.6 1.6 1.6 1.6 1.6 1.6 1.6 1.6 5.6; %33
1.1 1.1 0.79 0.79 1.1 1.1 0.79 0.79 0.93 0.93 0.93 1.1 1.1 1.1 1.1 0.46 0.46 0.46 0.46 0.46 0.43 0.43 1.6 1.6 1.1 1.1 1.1 1.1 1.1 1.1 0.43 0.43 1.6; %32
1.1 1.1 0.79 0.79 1.1 1.1 0.79 0.79 0.93 0.93 0.93 1.1 1.1 1.1 1.1 0.46 0.46 0.46 0.46 0.46 0.43 0.43 1.6 1.6 1.1 1.1 1.1 1.1 1.1 1.1 0.43 0.43 1.6; %31
1.6 1.6 1.0 1.0 1.6 1.6 1.0 1.0 1.3 1.3 1.3 1.6 1.6 1.6 1.6 1.1 1.1 1.1 1.1 1.1 1.1 1.1 1.6 1.6 1.6 1.6 1.6 1.6 1.6 1.6 1.1 1.1 1.6; %30
1.6 1.6 1.0 1.0 1.6 1.6 1.0 1.0 1.3 1.3 1.3 1.6 1.6 1.6 1.6 1.1 1.1 1.1 1.1 1.1 1.1 1.1 1.6 1.6 1.6 1.6 1.6 1.6 1.6 1.6 1.1 1.1 1.6; %29
1.6 1.6 1.0 1.0 1.6 1.6 1.0 1.0 1.3 1.3 1.3 1.6 1.6 1.6 1.6 1.1 1.1 1.1 1.1 1.1 1.1 1.1 1.6 1.6 1.6 1.6 1.6 1.6 1.6 1.6 1.1 1.1 1.6; %28
1.6 1.6 1.0 1.0 1.6 1.6 1.0 1.0 1.3 1.3 1.3 1.6 1.6 1.6 1.6 1.1 1.1 1.1 1.1 1.1 1.1 1.1 1.6 1.6 1.6 1.6 1.6 1.6 1.6 1.6 1.1 1.1 1.6; %27
1.6 1.6 1.0 1.0 1.6 1.6 1.0 1.0 1.3 1.3 1.3 1.6 1.6 1.6 1.6 1.1 1.1 1.1 1.1 1.1 1.1 1.1 1.6 1.6 1.6 1.6 1.6 1.6 1.6 1.6 1.1 1.1 1.6; %26
1.6 1.6 1.0 1.0 1.6 1.6 1.0 1.0 1.3 1.3 1.3 1.6 1.6 1.6 1.6 1.1 1.1 1.1 1.1 1.1 1.1 1.1 1.6 1.6 1.6 1.6 1.6 1.6 1.6 1.6 1.1 1.1 1.6; %25
];
xvalues=[1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33];
yvalues=[1 2 3 4 5 6 7 8 9 ];
h=heatmap(xvalues,yvalues,cdata);
  2 件のコメント
Adam Danz
Adam Danz 2022 年 7 月 8 日
I edited your question to remove the screen shot and replace it with the figure generated by the "run feature". I also formatted your code.
This can all be achieved by using tools in the toolbar when editing your question.
myrto pieridou
myrto pieridou 2022 年 7 月 18 日
Thank you soooo much!!!!!

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

回答 (1 件)

Adam Danz
Adam Danz 2022 年 7 月 8 日
編集済み: Adam Danz 2022 年 7 月 13 日
The cell values in heatmap appear when the figure is large enough to fit them in. Increase your figure size or decrease the density of the heatmap to make space for the text labels.
You can programmatically maximize the figure using
set(gcf, 'WindowState', 'maximized')
Alternatively, you can create a heatmap look-alike using imagesc which is demo'd here. The text labels won't disappear in this workaround.
  1 件のコメント
myrto pieridou
myrto pieridou 2022 年 7 月 18 日
Thank you!!! You help me a lot!!

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

カテゴリ

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