How to hide the value of each matrix in heatmap?
39 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
In Matlab the heatmap always show the value of each cell, I am wandering how to hide the value of each matrix in heatmap just like below? Thanks
Respuestas (2)
Ameer Hamza
el 10 de Sept. de 2020
Editada: Ameer Hamza
el 10 de Sept. de 2020
There does not seem to be a documented way to do this using heatmap. However, you can get something similar using pcolor(). For example
f = figure();
x = rand(20);
pcolor(x)
% show value for randomly selected 30 squares
rows = randi([1 size(x, 1)-1], 30, 1);
cols = randi([1 size(x, 2)-1], 30, 1);
idx = sub2ind(size(x), rows, cols);
vals = x(idx);
texts = num2str(vals, '%.1f');
text(cols + 0.5, rows + 0.5, texts, ...
'HorizontalAlignment', 'center')
0 comentarios
Diego Campos
el 28 de Dic. de 2021
Try to set de 'FontSize' to zero:
H = heatmap(...,'FontSize',0);
It worked for me.
0 comentarios
Ver también
Categorías
Más información sobre Data Distribution Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!