Issue with figure display

조회 수: 13 (최근 30일)
Turbulence Analysis
Turbulence Analysis 2022년 3월 10일
댓글: Turbulence Analysis 2022년 3월 10일
Hi,
I have used below command inside the for loop to avoid the display of figures. However, if I run some other command even in new editor page there is no figure display at all. And also, the new figures are always overlapping with the previous ones..
This problem is getting rectified only if I restart the Matlab..
I seriuosly don't know what's happening with this command,, Any help please ??
set(0,'DefaultFigureVisible','off')

채택된 답변

Rik
Rik 2022년 3월 10일
The command you posted will set the default visibility property to off. That means that a new figure that is created will have its visibility turned off. This setting affects every figure creation in Matlab.
You should change the code in your loop to create the figures with their visibility off instead.
If that is not possible, you should restore the default when you're done.
DefaultFigureVisible=get(0,'DefaultFigureVisible');
set(0,'DefaultFigureVisible','off')
% rest of your code
set(0,'DefaultFigureVisible',DefaultFigureVisible)
  댓글 수: 8
Rik
Rik 2022년 3월 10일
That is what I suggested as well (as the preferred solution actually): if create new figures in your loop, you should set the Visible property then.
for n=1:10
f(n)=figure('Visible','off');
ax=axes('Parent',f(n));
plot(rand(10,1),'Parent',ax)
title(sprintf('n=%d',n))
end
set(f(randi(end)),'Visible','on')
Turbulence Analysis
Turbulence Analysis 2022년 3월 10일
Sure.. Thanks

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

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