Jump to content

Talk:Matplotlib

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 91.97.79.3 (talk) at 12:39, 1 July 2009 (Python 2.6). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
WikiProject iconComputing: Software Stub‑class
WikiProject iconThis article is within the scope of WikiProject Computing, a collaborative effort to improve the coverage of computers, computing, and information technology on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
StubThis article has been rated as Stub-class on Wikipedia's content assessment scale.
???This article has not yet received a rating on the project's importance scale.
Taskforce icon
This article is supported by WikiProject Software.
Note icon
This article has been automatically rated by a bot or other tool as Stub-class because it uses a stub template. Please ensure the assessment is correct before removing the |auto= parameter.

Claim of memory leaks

On the article page, I claimed that "as of October 2005, basic plotting commands in Matplotlib suffer from memory leaks." Someone will probably dispute me on that (or perhaps show how it can be avoided). Here's how I tested for memory leaks:

>>> from pylab import *
>>> plot(range(10000), range(10000))
>>> show()
>>> plot(range(10000), range(10000))
>>> plot(range(10000), range(10000))
>>> plot(range(10000), range(10000))
>>> plot(range(10000), range(10000))
>>> plot(range(10000), range(10000))
>>> plot(range(10000), range(10000))

Note how the process memory usage increases continuously with each new plot command. - Connelly 00:58, 14 October 2005 (UTC)[reply]

Yep, someone will dispute you:-). matplotlib by default does not clear the previous plot, so you are adding many equivalent lines to the same plot. memory leaks in matplotlib have been hunted down agressively for many releases: there are FAQs about them and unit tests to detect them. To prevent the so-called leak in your example, set the hold rc property to False., or plor with plot(x,y,hold=False).

May I humbly suggest that you learn matplotlib, read it FAQ, and post to the user's list before posting disparaging comments on the wikipedia. Your, the matplotlib author, John Hunter.

I tried hold(False) and plot(..., hold=False), to no avail. See bug 1366913. Anyway, I probably shouldn't have been complaining about memory leaks in a pre-1.0 library on Wikipedia, so apologies for that, it was rude. - Connelly 09:30, 5 February 2006 (UTC)[reply]

The above is original research81.174.255.69 (talk) 13:25, 29 June 2009 (UTC)[reply]


This article seems a whole lot like a sales pitch to me... -Kevin Holzer

Python 2.6

I am using mathplot with 2.6.2 and it just works (tm)