Issue with figure display

24 次查看(过去 30 天)
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')

请先登录,再进行评论。

更多回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by