No BSD License  

Highlights from
"Smart"/Silent Figure

4.83333

4.8 | 6 ratings Rate this file 18 Downloads (last 30 days) File Size: 290 Bytes File ID: #8919

"Smart"/Silent Figure

by Daniel Eaton

 

02 Nov 2005 (Updated 03 Nov 2005)

Create or switch to a figure without it stealing focus from other windows.

| Watch this File

File Information
Description

In Windows, MATLAB R14's FIGURE behaviour can be annoying. Namely, whenever we invoke figure/figure(X), it immediately jumps to the foreground, and steals focus from whatever other window was active, preventing you from switching to other processes, the MATLAB editor window, etc... (if you are repeatedly switching between figures/displaying results in a loop). This wrapper to figure makes FIGURE silent -- ie. if you had figure X in the background, then the call figure(X) will keep that figure in the background.

Acknowledgements
This submission has inspired the following:
Let me work, figure!
MATLAB release MATLAB 7.0.1 (R14SP1)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (9)
04 Nov 2005 Stephen Hole

Very useful.
Thanks!

16 Nov 2005 Jean-Yves Tinevez

Usefull !
Is there a way to tweak the "axes" command in the same way ? So that one can update an existing figure without stealing the focus...

31 Oct 2006 Matt Hilt

You can quiet the axes by first setting the current figure as is done by this function, then setting the current axes in that figure.

Eg.
set(0,'currentFigure',figureHandle)
set(figureHandle,'currentAxes',axesHandle)

31 Mar 2007 Brian Armstrong

Helpful.

It would be nice to be able to separately control whether the figure come to the top and whether it steals the focus. Especially
in X windows.

14 Jun 2007 Curtis I

Hah! This is awesome. Thanks!

05 Jul 2007 Adrian G

Works perfectly. Thanks!

30 Jul 2007 Sorin Z

Very very useful for Mac OSX!! Thanks.

30 Jul 2007 Sorin Z  
22 Oct 2009 Dominic Barone

You can make it more like figure() by using varargout. This way you can avoid having to put a semi-colon at the end.

Change the function call to:
function varargout = sfigure(h)

And add this to the end:
if nargout == 1
varargout{1} = h;
end

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
gui tools Daniel Eaton 22 Oct 2008 08:05:24
example Daniel Eaton 22 Oct 2008 08:05:24
figure Cristina McIntire 10 Dec 2008 16:51:26
focus Cristina McIntire 10 Dec 2008 16:51:26
silent Cristina McIntire 10 Dec 2008 16:51:26
steals Cristina McIntire 10 Dec 2008 16:51:26
focus Dan 15 Apr 2011 10:11:02
example McLauren 18 Jan 2012 10:12:02

Contact us at files@mathworks.com