How to stop a plot window to open in app designer?
Show older comments
Hey,
I am currently working with App Designer trying to make a user interface for a Source Mesurement Unit and this is basically what i have of the interface so far.

What i want is the signal to start appearing in the plots, i have the following code. I don't understand some parts of it, i found it online.

Basically what happens is that the signal is plotted in the first graph but also a new window opens apart from the interface and i don't know how to make it go away and don't appear anymore. 

I will appreciate any help with this thing and also if you could help me to understand better how the plots work it would be great. Thanks!
Accepted Answer
More Answers (2)
Ali Mostaed
on 8 Oct 2020
2 votes
I had this issue and could not figure out what was the source of that. It's funny that the blank figure does not pop up if you run the code in the command window, but it does inside the app!! Finally I resolved it by adding "close(gcf)" at the end
1 Comment
Adam Danz
on 8 Oct 2020
Well, that closes the figure that was incorrectly opened. Instead, supply the figure or axis handle to whatever function is opening that figure instead of using the default gca/gcf/
Biruk Belay
on 9 Aug 2022
For me it worked this way: I included this code right before the main UIAxes
fig1 = figure();
set(fig1, 'Visible', 'off'); % removes the default figure pop-up during live plot.
2 Comments
Adam Danz
on 9 Aug 2022
Instead of generating the visible figure and then turning visibility off, you could generate the figure with visibility off to begin with.
fig1 = figure('visible','off');
Biruk Belay
on 10 Aug 2022
Yes, that is a better way of writing it. Thanks!!
Categories
Find more on Creating, Deleting, and Querying Graphics Objects in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!