Matlab figure(s) suppression not working

조회 수: 14 (최근 30일)
Preetham Manjunatha
Preetham Manjunatha 2018년 4월 3일
편집: Seren 2021년 2월 15일
Hello:
I have some issue suppressing the figure(s) in Matlab. I referred to these solutions Figure suppression 1 and Figure suppression 2.
I am using Matlab 2017b. First, I used both commands at the top of my main.m file:
set(groot, 'DefaultFigureVisible', 'off');
set(0, 'DefaultFigureVisible', 'off');
But, no help. Figures are still showing up while running the main. Please note that I have figure(s) callback inside few functions. In addition, I have a waitbar command running. While starting in cmd, if I use:
matlab -noFigureWindows
Figures including the Waitbar are not displayed. Is there any way I can only suppress the figure(s) running in a loop?
Thanks,
  댓글 수: 2
Nicolo Zulaybar
Nicolo Zulaybar 2020년 5월 18일
Did you ever find a nice solution? I'm interested in the same functionality.
Preetham Manjunatha
Preetham Manjunatha 2020년 5월 18일
No, but I would suggest to have a flag to turn the figures on/off.

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

답변 (2개)

Walter Roberson
Walter Roberson 2020년 5월 18일
It is not possible to prevent figures from displaying when figure() is called. When figure() is called to create a new figure, and when figure() is called to bring a figure into focus, then in both cases, the figure is always made visible, even if only briefly.
The only way to prevent this is to be running in a mode that cannot display graphics. For example if you have the Parallel Computing Toolbox, you could run the graphics on a parallel process, as those processes cannot affect the graphic output. You can still render and saveas() or print() inside those processes (though I do not promise that all graphics effects can be used.)

Seren
Seren 2021년 2월 15일
편집: Seren 2021년 2월 15일
In my own scripts, I avoid using
set(groot, 'DefaultFigureVisible', 'off|on')
to "control" the displaying of figures. Using 'visible', 'off|on' in a figure statement, e.g.:
figure ('visible','off','name','Fig. 1', 'NumberTitle','off','position', [200 486 1235 428]);
works.

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by