Stretching of a figure margins

조회 수: 5 (최근 30일)
Wouter
Wouter 2015년 12월 3일
댓글: Jacek 2019년 7월 30일
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);
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?
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.

답변 (1개)

Ilham Hardy
Ilham Hardy 2015년 12월 3일
This has become a frequent question,
  댓글 수: 3
Ilham Hardy
Ilham Hardy 2015년 12월 3일
It's either using this
set(gca,'LooseInset',get(gca,'TightInset'))
or use the file exchange subs.
Jacek
Jacek 2019년 7월 30일
set(gca,'LooseInset',get(gca,'TightInset'))
This does not work and never worked. I don't know why so many people recommend this...

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Subplots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by