Path: news.mathworks.com!not-for-mail
From: "Stephan" <stephanjunek@hotmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: How to suppress figure() to bring figure to foreground?
Date: Wed, 16 Sep 2009 17:22:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 29
Message-ID: <h8r6rq$mbv$1@fred.mathworks.com>
References: <cd62214e-2635-4f6d-a367-eb8fbfaef57b@o36g2000vbl.googlegroups.com>
Reply-To: "Stephan" <stephanjunek@hotmail.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1253121722 22911 172.30.248.37 (16 Sep 2009 17:22:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 16 Sep 2009 17:22:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 937390
Xref: news.mathworks.com comp.soft-sys.matlab:570871


Joe Duchtel <duchtel@gmail.com> wrote in message <cd62214e-2635-4f6d-a367-eb8fbfaef57b@o36g2000vbl.googlegroups.com>...
> Hello -
> 
> I realize that I need to use the figure() command to create a figure
> but is there any way that it will not automatically bring each figure
> to the forground if it is called for a figure that is already open?
> This happens since I run an m-file several times without closing each
> figure prior to a new run.
> 
> Is there a way to get a list of all open figures?  I tried get(0) but
> the 'CurrentFigure' will only tell the currently active figure.
> 
> Thanks,
> Joe

I'm not sure what you wanna do, but you can usually indicate the object in which you want to plot. If you want to plot in the (only) axis of a figure with handle fig, you could write

plot(get(fig,'Children'), 1:1000)

In this way the data is plotted in the correct axis without the figure being moved to the top of the screen. I usually "remember" the handles to axis and figures if i want to draw into them multiple times, e.g.

fig1 = figure;
ax1 = axes;

etc.

Hope that helps. If not, maybe post some of your code.

Stephan