Set the width of a subplot & leave all else unchanged

27 vues (au cours des 30 derniers jours)
z8080
z8080 le 14 Avr 2022
Modifié(e) : z8080 le 14 Avr 2022
I have code that generates the following figure with subplots:
I'd like to reduce the width of each subplot and leave more room to the subplotTitles at the left. Resizing the entire figure window doesn't work, as everything is resized proportionately. If I use the EditPlot tool, I can manually reduce the width of the subplot using the mouse:
and then manually move the subplotTitle to the left, bringing me to my desired figure layout:
However, I'd like to do this with code. I know from here that the [x,y,width,height] of the entire axes handle can be specified; however, I don't want to override the automatically-computed y position and height - I only want to reduce the width.
Can I somehow only scale the width param of each subplot, while leaving all others unchanged?

Réponse acceptée

z8080
z8080 le 14 Avr 2022
Modifié(e) : z8080 le 14 Avr 2022
Managed to find this out on my own. Code of the following sort is required for the subplots:
sph(i) = subplot(N_seeds, 1, i_seed);
sph(i).Position = sph(i).Position + 0.07*[1 0 -1 0]; % reduce width and shift to the right, leave all else unchanged

Plus de réponses (0)

Produits


Version

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by