Path: news.mathworks.com!newsfeed-00.mathworks.com!NNTP.WPI.EDU!elk.ncren.net!newsflash.concordia.ca!canopus.cc.umanitoba.ca!not-for-mail
From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Newsgroups: comp.soft-sys.matlab
Subject: Re: Adding New Axes Object to a Figure
Date: Mon, 28 Jan 2008 17:00:29 +0000 (UTC)
Organization: National Research Council Canada - Conseil national de rechereches Canada
Lines: 45
Message-ID: <fnl1nd$oc4$1@canopus.cc.umanitoba.ca>
References: <fnjgsl$g4q$1@fred.mathworks.com> <fnjmjk$34v$1@canopus.cc.umanitoba.ca> <fnkubm$l0k$1@fred.mathworks.com>
NNTP-Posting-Host: origin.ibd.nrc.ca
X-Trace: canopus.cc.umanitoba.ca 1201539629 24964 192.70.172.160 (28 Jan 2008 17:00:29 GMT)
X-Complaints-To: abuse@cc.umanitoba.ca
NNTP-Posting-Date: Mon, 28 Jan 2008 17:00:29 +0000 (UTC)
Originator: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Xref: news.mathworks.com comp.soft-sys.matlab:447962


In article <fnkubm$l0k$1@fred.mathworks.com>,
jk Wang <wjk1984@gmail.com> top-posted:

Please do not post your reply above the text you are replying to:
it makes it difficult to hold a conversation.

>roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in
>message <fnjmjk$34v$1@canopus.cc.umanitoba.ca>...
>> In article <fnjgsl$g4q$1@fred.mathworks.com>,
>> jk Wang <wjk1984@gmail.com> wrote:

>> >I want to write a program that can adding new axes, but 
>> >without changing the other axes existing on the figure. All 
>> >of these axes display different images. 

>> >So how can I keep the former axes (and their images) 
>> >unchanged while adding a new one? Help me please~ 

>> Just do it. The axes() function does not clear the figure.

>I thought axes() won't change previous axes objects, but
>when I tried the following codes, the image displayed were
>cleared by an new axes.

>Here's my code,

>figure; 
>h1 = gcf;
>axes(h1)

That should be axes('Parent',h1);

>imshow(imread('lego08.gif')) %display an image
>figure(h1);axes              %create another axes.

That does not clear the existing axes or image. Instead, it is
putting the new axis right on top of the old one, as you did not
specify a position or size for the new axis. If you look closely,
you will probably notice that the x and y axis labels are doubled,
two sets of labels in the same area.
-- 
  "I will speculate that [...] applications [...] could actually see a
  performance boost for most users by going dual-core [...] because it
  is running the adware and spyware that [...] are otherwise slowing
  down the single CPU that user has today"           -- Herb Sutter