Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Instantiation of multiple images in a GUI
Date: Wed, 19 Nov 2008 21:27:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 28
Message-ID: <gg20b6$hj5$1@fred.mathworks.com>
References: <gg1j76$88v$1@fred.mathworks.com> <6305c99d-54d2-47be-a77c-4449b57420b6@e6g2000vbe.googlegroups.com> <236663b5-3953-416e-a6d9-256634da7feb@g38g2000yqd.googlegroups.com>
Reply-To: <HIDDEN>
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 1227130022 18021 172.30.248.37 (19 Nov 2008 21:27:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 19 Nov 2008 21:27:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1268168
Xref: news.mathworks.com comp.soft-sys.matlab:501846


The tutorial I cited explains why.

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <236663b5-3953-416e-a6d9-256634da7feb@g38g2000yqd.googlegroups.com>...
> On Nov 19, 3:54=A0pm, "Thiago " <thi...@mathworks.com> wrote:
> > I've found a solution! After creating axes objects in GUIDE, place this c=
> ode inside each "axes_CreateFcn" callback:
> >
> > axes(hObject)
> > imshow('file.extension');
> > title('')
> >
> > I am able to instantiate multiple images in the same figure with this tec=
> hnique, which originated from this tutorial by Doug Hull:
> >
> > http://blogs.mathworks.com/pick/2007/10/16/matlab-basics-setting-a-ba...
> 
> -------------------------------------------------------------------
> Yes, most of the time you need to call the axes command to set the
> current graphics object (the "gca") to the one you want to put stuff
> into before you put the stuff in.  So that's why it worked for you.
> It's a bit puzzling though.  You'd think that inside the creation
> callback for the axes, that the gca would already be that axes, but
> maybe not.  In other words I'm surprised you had to do that because
> you'd think that that would have already been done automatically
> without you having to explicitly do it.  Maybe that doesn't occur
> until the creation callback completely terminates.  But if that were
> the case, (the axes weren't yet full created) then how could you issue
> an axes() command to it?