How to detect the changes in figure size to invoke a callback function?

조회 수: 31 (최근 30일)
I noticed that design and layout of a figure can be compromised when the figure's size or dimension is changed.
In most cases, use of 'Units' = 'normalized' can work, but not always.
For example, UI control buttons and sliders can be squashed by 'Units' = 'normalized'. To keep the size of uicontrol objects practical, you would have to change the 'Units' to 'px' and fix the size of buttons and sliders and then set them back to 'normalized'.
I wonder if this is possible with a callback function for figure object. Can a figure object detect its own change in size and invoke a callback function?

채택된 답변

Adam
Adam 2017년 8월 18일
The 'SizeChangedFcn' property of the figure can be used for this.
  댓글 수: 1
Kouichi C. Nakamura
Kouichi C. Nakamura 2017년 8월 18일
Superb! It worked magically. I spent a good time searching this for figure property documentation but could not find it. Thanks a lot for the prompt answer!

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

추가 답변 (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