How to paste multiple heatmaps together/in 1 figure
21 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Aaron Ouyang
le 13 Juil 2022
Réponse apportée : Walter Roberson
le 13 Juil 2022
Hi,
I've created three heatmaps and I was just wondering if it was possible for me to combine them together or into 1 figure. I included some pictures for reference, thanks.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1064795/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1064800/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1064805/image.png)
0 commentaires
Réponse acceptée
Voss
le 13 Juil 2022
You can use subplot (or tiledlayout)
figure()
subplot(3,1,1)
heatmap(rand(3,5))
subplot(3,1,2)
heatmap(rand(3,5))
subplot(3,1,3)
heatmap(rand(3,5))
0 commentaires
Plus de réponses (1)
Walter Roberson
le 13 Juil 2022
You can pass a figure or axes to heatmap as the first parameter. If you pass an axes then it the children might get completely replaced.
The output of heatmap() is a special object that acts like an axes.
heatmap() accepts Position property; https://www.mathworks.com/help/matlab/ref/matlab.graphics.chart.heatmapchart-properties.html#d123e612890
0 commentaires
Voir également
Catégories
En savoir plus sur Data Distribution Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!