[Numpy-discussion] matplotlib is breaking numpy
Thu Nov 19 12:30:38 CST 2009
On Nov 19, 2009, at 11:57 AM, Robert Kern <firstname.lastname@example.org> wrote:
> On Thu, Nov 19, 2009 at 11:52, Mathew Yeates <email@example.com>
>> There is definitely something wrong with matplotlib/numpy. Consider
>>> from numpy import *
>>> del mydata
>> I can now remove the file map.dat with (from the command line) $rm
>> If I plot mydata before the line
>>> del mydata
>> I can't get rid of the file until I exit python!!
>> Does matplotlib keep a reference to the data?
> Almost certainly.
>> How can I remove this
> Probably by deleting the plot objects that were created and close all
> matplotlib windows referencing the data. If you are using IPython, you
> should know that many of the returned objects are kept in Out, so you
> will need to clear that. There might be some more places internal to
> matplotlib, I don't know.
Closing the figure window containg the data *should* be enough. In
pylab/pyplot, this also triggers a call to gc.collect.
> With some care, you can use gc.get_referrers() to find the objects
> that are holding direct references to your memmap.
> Robert Kern
> "I have come to believe that the whole world is an enigma, a harmless
> enigma that is made terrible by our own mad attempt to interpret it as
> though it had an underlying truth."
> -- Umberto Eco
> NumPy-Discussion mailing list
More information about the NumPy-Discussion