Moving a Figure's position inside a script

조회 수: 1 (최근 30일)
Gabriel
Gabriel 2015년 7월 20일
편집: Jan 2015년 7월 22일
Hello all,
I wish to move a given Figure window, as part of a bigger project. For this, I tried the following piece of code:
function testWindow()
set(gcf, 'units', 'norm');
pos = get(gcf, 'position');
set(gcf, 'position', [0.5 0.5 0.2 0.2]);
set(gcf, 'position', pos);
end
Here I see that the first set command works fine, but the second one doesn't bring 'back' the Figure window to its original place.
What am I missing here? Any help would be greatly appreciated! All the best, Gabriel

채택된 답변

Jan
Jan 2015년 7월 22일
편집: Jan 2015년 7월 22일
Are you sure?
Try to add a drawnow command to allow Matlab to update the display.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by