How to make figure window change size

조회 수: 2,071 (최근 30일)
Oladunjoye Awoga
Oladunjoye Awoga 2017년 1월 11일
댓글: Savannah Downing 2022년 2월 15일
The figure window stopped responding to commands. The figure window size does not change when I try to resize it using set(gcf, [ four values]) which I have been using for sometime now. I have entered all the usual commands I normally use (from the command window) but it has no effects. It seems the window size is fixed so I need to make flexible. This started a day ago. How can I make it work again?
I use R2016a.
Thanks in advance.

채택된 답변

Jordan Ross
Jordan Ross 2017년 1월 13일
편집: MathWorks Support Team 2021년 3월 17일
Hello,
As I understand, you are trying to resize your window using the following command:
>> set(gcf, [ four values])
However, you forgot to specify the name of the ‘Position’ property. For example, here’s how to set the figure to be 500 pixels by 400 pixels:
>> set(gcf, 'Position', [100, 100, 500, 400])
You can also save a handle to your figure and set the Position property using dot notation:
f = figure;
f.Position = [100 100 550 400];
  댓글 수: 5
Grzegorz Lippe
Grzegorz Lippe 2020년 10월 30일
'Position' refers to the inner part of the figure. How can I adress the whole Window size?
scr_siz = get(0,'ScreenSize') ;
figure(floor([scr_siz(3)/2 scr_siz(4)/2 scr_siz(3)/2 scr_siz(4)/2])) ;
The example above creates a figure in the upper right corner, but the menu and control elements are out of the screen boundaries.
Savannah Downing
Savannah Downing 2022년 2월 15일
@Grzegorz Lippe did you ever figure this out? i am having the same issue and can't find info on how to address the whole window size

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by