Add a title to a group of 4 subplots centred at the top
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have a group of subplots and want to add a title at the top, centre. How might one do this? Here is an MWE
subplot(2,2,1)
plot(peaks)
subplot(2,2,2)
plot(peaks)
subplot(2,2,3)
plot(peaks)
subplot(2,2,4)
plot(peaks)
0 commentaires
Réponses (2)
Les Beckham
le 15 Août 2024
I would suggest using tiledlayout instead of subplot. Then you attach the title to the tiledlayout rather than any of the individual plots.
tl = tiledlayout(2,2);
nexttile
plot(peaks)
nexttile
plot(peaks)
nexttile
plot(peaks)
nexttile
plot(peaks)
title(tl, 'Common title')
0 commentaires
Voir également
Catégories
En savoir plus sur Subplots dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!