<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/246242</link>
    <title>MATLAB Central Newsreader - Clearing drawn lines from a figure window</title>
    <description>Feed for thread: Clearing drawn lines from a figure window</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Mon, 09 Mar 2009 19:20:17 -0400</pubDate>
      <title>Clearing drawn lines from a figure window</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/246242#633579</link>
      <author>Patrick </author>
      <description>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. </description>
    </item>
    <item>
      <pubDate>Mon, 09 Mar 2009 19:41:42 -0400</pubDate>
      <title>Re: Clearing drawn lines from a figure window</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/246242#633584</link>
      <author>Ashish Uthama</author>
      <description>On Mon, 09 Mar 2009 15:20:17 -0400, Patrick  &amp;lt;praphael@bcm.tmc.edu&amp;gt; wrote:&lt;br&gt;
&lt;br&gt;
&amp;gt; Is there any way to clear lines drawn with the line() command from a  &lt;br&gt;
&amp;gt; figure window?  clear() doesn't seem to work.  Clearing the entire  &lt;br&gt;
&amp;gt; figure resets the axes to defaults, and its an image window where you  &lt;br&gt;
&amp;gt; don't want axes.  I'm not sure how to redraw the image though if thats  &lt;br&gt;
&amp;gt; the only way to do it I will need a ay to redraw it quickly.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
help line&lt;br&gt;
...&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;LINE returns a column vector of handles to LINE objects,&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;one handle per line. LINEs are children of AXES objects.&lt;br&gt;
...&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
You can delete this handle to remove the line from the figure.&lt;br&gt;
&lt;br&gt;
lh=line(&amp;lt;...&amp;gt;)&lt;br&gt;
%use the below when you want to delete the line&lt;br&gt;
delete(lh)&lt;br&gt;
&lt;br&gt;
If you cant/dont want to do the above, you could use the FINDOBJ to search  &lt;br&gt;
for the line object (tricky if you have multiple lines). This is just to  &lt;br&gt;
let you know of an alternative.. I would recommend using the first  &lt;br&gt;
approach.</description>
    </item>
    <item>
      <pubDate>Mon, 09 Mar 2009 19:49:01 -0400</pubDate>
      <title>Re: Clearing drawn lines from a figure window</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/246242#633586</link>
      <author>Adam </author>
      <description>&quot;Patrick &quot; &amp;lt;praphael@bcm.tmc.edu&amp;gt; wrote in message &amp;lt;gp3q5h$8te$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; 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. &lt;br&gt;
&lt;br&gt;
one way&lt;br&gt;
hLine = line([1 1], [0 0]);  % draw line&lt;br&gt;
&lt;br&gt;
delete(hLine)  % delete line&lt;br&gt;
&lt;br&gt;
If you're going to reuse the line later this may be preferable&lt;br&gt;
set(hline, 'XData', [], 'YData', [])&lt;br&gt;
&lt;br&gt;
If you need to update the figure&lt;br&gt;
drawnow()&lt;br&gt;
&lt;br&gt;
~Adam</description>
    </item>
    <item>
      <pubDate>Thu, 10 Nov 2011 09:54:28 -0500</pubDate>
      <title>Re: Clearing drawn lines from a figure window</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/246242#858057</link>
      <author>KYAW KYAW</author>
      <description>Dear Patrick,&lt;br&gt;
&lt;br&gt;
Thank you for your clearing ways and I am looking for to remove some segments of the line only.&lt;br&gt;
How should and please advise me.&lt;br&gt;
&lt;br&gt;
Thanks and best regards&lt;br&gt;
Kyaw&lt;br&gt;
&lt;br&gt;
&quot;Adam&quot; wrote in message &amp;lt;gp3rrd$2ka$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &quot;Patrick &quot; &amp;lt;praphael@bcm.tmc.edu&amp;gt; wrote in message &amp;lt;gp3q5h$8te$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; 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. &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; one way&lt;br&gt;
&amp;gt; hLine = line([1 1], [0 0]);  % draw line&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; delete(hLine)  % delete line&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; If you're going to reuse the line later this may be preferable&lt;br&gt;
&amp;gt; set(hline, 'XData', [], 'YData', [])&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; If you need to update the figure&lt;br&gt;
&amp;gt; drawnow()&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; ~Adam</description>
    </item>
  </channel>
</rss>

