use of del() to delete a line

TP wrote:

I have a question about the behavior of "del()" Python built-in.

Ok, del only removes a name from the local namespace.
I have found an old answer of John, below. It seems that a better solution
is to use the remove method of a line instance:

http://osdir.com/ml/python.matplotlib.general/2005-05/msg00045.html

Until now, I used "del" which works well when the complete object hierarchy
is given...

Thanks

Julien

···

--
python -c "print ''.join([chr(154 - ord(c)) for c in '*9(9&(18%.9&1+,\'Z
(55l4('])"

"When a distinguished but elderly scientist states that something is
possible, he is almost certainly right. When he states that something is
impossible, he is very probably wrong." (first law of AC Clarke)

The line is stored in axes.lines list, so simply deleting it will not
work because there is a reference to it in the list. You need to
remove it from the list, as you inidicate. See also

http://matplotlib.sourceforge.net/users/artists.html

···

On Thu, Dec 11, 2008 at 7:56 AM, TP <paratribulations@...185...> wrote:

TP wrote:

I have a question about the behavior of "del()" Python built-in.

Ok, del only removes a name from the local namespace.
I have found an old answer of John, below. It seems that a better solution
is to use the remove method of a line instance:

http://osdir.com/ml/python.matplotlib.general/2005-05/msg00045.html

Until now, I used "del" which works well when the complete object hierarchy
is given...