Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!g38g2000yqd.googlegroups.com!not-for-mail
From: ImageAnalyst <imageanalyst@mailinator.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Instantiation of multiple images in a GUI
Date: Wed, 19 Nov 2008 13:14:27 -0800 (PST)
Organization: http://groups.google.com
Lines: 25
Message-ID: <236663b5-3953-416e-a6d9-256634da7feb@g38g2000yqd.googlegroups.com>
References: <gg1j76$88v$1@fred.mathworks.com> <6305c99d-54d2-47be-a77c-4449b57420b6@e6g2000vbe.googlegroups.com> 
	<gg1uda$oom$1@fred.mathworks.com>
NNTP-Posting-Host: 192.44.136.113
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1227129268 706 127.0.0.1 (19 Nov 2008 21:14:28 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Wed, 19 Nov 2008 21:14:28 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: g38g2000yqd.googlegroups.com; posting-host=192.44.136.113; 
	posting-account=0rLUzAkAAABojYSRC64DkTbtiSCX77HH
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET 
	CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 
	3.5.21022),gzip(gfe),gzip(gfe)
X-HTTP-Via: 1.1 bdci2px (NetCache NetApp/6.0.7)
Xref: news.mathworks.com comp.soft-sys.matlab:501844


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?