Stretching of a figure margins
9 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I have a questions regarding the stretching of Matlab figures. Below you see a figure with three subplots. This was simply generated by
figure;
subplot(1,3,1);
subplot(1,3,2);
subplot(1,3,3);
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/152451/image.png)
Now when I stretch the figure in horizontal direction the subplots become larger. Which is exactly what I want. However, the margin/padding w.r.t. to the border of the window becomes much larger. Furthermore, the spacing between the plots also becomes larger. How can you make sure that this is fixed?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/152452/image.png)
The red border shows the picture I would get when I export it to .jpg or .png, for example. And the blue border describes what I want with space reduction between the plots.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/152453/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/152454/image.png)
0 Commenti
Risposte (1)
Ilham Hardy
il 3 Dic 2015
This has become a frequent question,
3 Commenti
Ilham Hardy
il 3 Dic 2015
It's either using this
set(gca,'LooseInset',get(gca,'TightInset'))
or use the file exchange subs.
http://www.mathworks.com/matlabcentral/fileexchange/23629-export-fig (a bit overkill for your purpose..)
Jacek
il 30 Lug 2019
set(gca,'LooseInset',get(gca,'TightInset'))
This does not work and never worked. I don't know why so many people recommend this...
Vedere anche
Categorie
Scopri di più su Subplots in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!