Issue with figure display

13 visualizzazioni (ultimi 30 giorni)
Turbulence Analysis
Turbulence Analysis il 10 Mar 2022
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')

Risposta accettata

Rik
Rik il 10 Mar 2022
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 Commenti
Rik
Rik il 10 Mar 2022
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 il 10 Mar 2022
Sure.. Thanks

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Interactive Control and Callbacks in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by