Path: news.mathworks.com!not-for-mail
From: "Anh Huy Phan" <phananhhuy@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Images in GUI
Date: Tue, 15 Jan 2008 17:03:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 102
Message-ID: <fmip05$hfh$1@fred.mathworks.com>
References: <fmhg3f$e5q$1@fred.mathworks.com> <fmi9bh$s3j$1@fred.mathworks.com> <fmieie$fbq$1@fred.mathworks.com> <fmim81$d4r$1@fred.mathworks.com>
Reply-To: "Anh Huy Phan" <phananhhuy@mathworks.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 1200416581 17905 172.30.248.37 (15 Jan 2008 17:03:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 15 Jan 2008 17:03:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 113206
Xref: news.mathworks.com comp.soft-sys.matlab:445820


"Vaibhav Bedia" <vaibhav.bedia@gmail.com> wrote in message 
<fmim81$d4r$1@fred.mathworks.com>...
> I tried putting what Anh said in the CreateFn of the axes 
> but it didnt work.Was that where i was supposed to put it?
> 
> But i got it working in a diff way.Added the following in 
> the OpeningFn of the GUI.
> 
> %load the background image into Matlab
> %if image is not in the same directory as the GUI files, 
> you must use the 
> %full path name of the image file
> Image1 = importdata('image1.jpg');
> Image2 = importdata('image2.jpg');
> %select the axes
> axes(handles.axes13);
> %place image onto the axes
> image(Image1);
> %remove the axis tick marks
> axis off
> 
> %select the axes
> axes(handles.axes12);
> %place image onto the axes
> image(Image2);
> %remove the axis tick marks
> axis off
> 
> % Update handles structure
> guidata(hObject, handles);
> 
> Maybe this will solve Szymon's problem also.
> 
> "Anh Huy Phan" <phananhhuy@mathworks.com> wrote in 
message 
> <fmieie$fbq$1@fred.mathworks.com>...
> > "Szymon Lipiec" <szymon.lipiec@gmail.com> wrote in 
> message 
> > <fmi9bh$s3j$1@fred.mathworks.com>...
> > > oi!
> > > i have similar problem ->
> > > i have 2 axes (axes1, axes2) on my figure in gui, 
when 
> i 
> > > set axes1 active [axes(handles.axes1)] and i check 
for 
> > tag 
> > > property i get apropriate tag -> 'axes1' in next line 
> i'm 
> > > showing pic with [imshow(pic)] 3rd line is chcecking 
> > again 
> > > for the tag property and BAM -> '' EMPTY 
> > > i even tried to name it again after imshowing but it 
> > > appears that somehow axes1 duplicates becouse finding 
> all 
> > > axes types results in showing 3 axes instead of 2:
> > > 
> > > axes =
> > > 'axes1'
> > > ''
> > > 'axes2'
> > > 
> > > if u have any ideas how to overcome it - please help
> > 
> > When you create the axes, the NextPlot property of this 
> > axes to "add" value
> > 
> > figure
> > 
> > set(gca,'NextPlot','add')
> > set(gca,'Tag','myaxes')
> > ...
> > ...
> > 
> > Anh Huy Phan
> > RIKEN - BSI
> 

I think this link is helpful for you

http://www.mathworks.com/support/solutions/data/1-
5BO0I4.html?solution=1-5BO0I4


There are two ways to set the "Nextplot" property 

   - Double-click on the axes in the GUIDE tool to open its 
Inspector.
   - Find "Nextplot" and choose the value "add"

or 

   - in the CreateFcn of the axes, add this line

     set(hObject,'Nextplot','add');

HTH
Anh Huy Phan
RIKEN - BSI