How do I decrease the margins around the subplots in my figure in MATLAB?
Afficher commentaires plus anciens
I would like to decrease the white space around my plots because when I copy the figure to a Word document, the margins around the axes reduces the size of the plot and I often have to crop this space out in order to increase the plot's size.
Réponse acceptée
Plus de réponses (2)
Jesús Lucio
le 12 Fév 2015
Hi,
I know the question is very old, but it's still very interesting.
A simple way of doing what you want (change margins of subplots) is this:
pos = get(gca, 'Position');
pos(1) = 0.055;
pos(3) = 0.9;
set(gca, 'Position', pos)
to write just after you create each (sub)plot.
This way each plot is resized. 'Position' is the axis property (a 1 x 4 vector) with these fields:
[x y width height]
Obviously, you can change any of the four values to your best choice.
Jesus.
KAE
le 20 Août 2021
1 vote
Catégories
En savoir plus sur Specifying Target for Graphics Output dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!