Path: news.mathworks.com!not-for-mail
From: "Ashish Uthama" <first.last@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Clearing drawn lines from a figure window
Date: Mon, 09 Mar 2009 15:41:42 -0400
Organization: TMW
Lines: 27
Message-ID: <op.uqjibspna5ziv5@uthamaa.dhcp.mathworks.com>
References: <gp3q5h$8te$1@fred.mathworks.com>
NNTP-Posting-Host: uthamaa.dhcp.mathworks.com
Mime-Version: 1.0
Content-Type: text/plain; format=flowed; delsp=yes; charset=iso-8859-15
Content-Transfer-Encoding: 7bit
X-Trace: fred.mathworks.com 1236627702 3764 172.31.57.126 (9 Mar 2009 19:41:42 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 9 Mar 2009 19:41:42 +0000 (UTC)
User-Agent: Opera Mail/9.63 (Win32)
Xref: news.mathworks.com comp.soft-sys.matlab:523577


On Mon, 09 Mar 2009 15:20:17 -0400, Patrick  <praphael@bcm.tmc.edu> wrote:

> Is there any way to clear lines drawn with the line() command from a  
> figure window?  clear() doesn't seem to work.  Clearing the entire  
> figure resets the axes to defaults, and its an image window where you  
> don't want axes.  I'm not sure how to redraw the image though if thats  
> the only way to do it I will need a ay to redraw it quickly.


help line
...
     LINE returns a column vector of handles to LINE objects,
     one handle per line. LINEs are children of AXES objects.
...


You can delete this handle to remove the line from the figure.

lh=line(<...>)
%use the below when you want to delete the line
delete(lh)

If you cant/dont want to do the above, you could use the FINDOBJ to search  
for the line object (tricky if you have multiple lines). This is just to  
let you know of an alternative.. I would recommend using the first  
approach.