Plot a heatmap from a matix
6 次查看(过去 30 天)
显示 更早的评论
I implemented the minutia heat map presented in this paper (page 7): https://arxiv.org/pdf/1909.09901.pdf
The result is that i have 6 matrixes and i am looking for a way to plot these as shown in the paper (same page), like this:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/245031/image.png)
Basically, the low values is presented in dark, and it gets lighter when it increase.
5 个评论
darova
2019-10-26
Make range for color axis the same for each figure
min = % minimum of 6 matrix
max = % maximum of 6 matrix
caxis([min max])
采纳的回答
darova
2019-10-26
You are using H for rows and W for columns
M1 = zeros(H,W);
% ...
for i = 1 : W
for j = 1 : H
% ...
M1(i,j) = Hijk; % looks like mistake
You can use cells to create 6 matrices automatically
MM = cell(6,1);
M = zeros(H,W);
for k = 1:6
for i
for j
for t
% do stuff
end
% ...
M(i,j) = %...
end
end
MM{k} = M;
end
After you found max and min values (global) use loop to visualize
for k = 1:6
figure(k)
heatmap(MM{k});
caxis([minx maxx])
colormap gray
end
11 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Distribution Plots 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!