canvas.draw() memory issue? (PyQt4)

Hi all,

I am encountering a memory leak type issue when running the following,
for example.

http://codepad.org/TNuCLT3k

Matplotlib version: 0.99.3
PyQt4 Version: 4.8.5

I found a thread in the archive relating to this issue which supposedly
disappeared upon updating to PyQt 4.8.4 (I trust it would not have been
reintroduced in going to .5).

Can someone confirm or deny replication of this issue with their setup
and/or offer a solution?

Thanks very much
Matt Earnshaw

Confirmed with:

PyQt4 4.8.3

Matplotlib 1.1.0

Not sure what the cause is though.

Keith

···

On Fri, Sep 9, 2011 at 6:04 PM, Matt Earnshaw <matt@…3774…> wrote:

Hi all,

I am encountering a memory leak type issue when running the following,

for example.

http://codepad.o rrg/TNuCLT3k

Matplotlib version: 0.99.3

PyQt4 Version: 4.8.5

I found a thread in the archive relating to this issue which supposedly

disappeared upon updating to PyQt 4.8.4 (I trust it would not have been

reintroduced in going to .5).

Can someone confirm or deny replication of this issue with their setup

and/or offer a solution?

Thanks very much

Matt Earnshaw


Why Cloud-Based Security and Archiving Make Sense

Osterman Research conducted this study that outlines how and why cloud

computing security and archiving is rapidly being adopted across the IT

space for its ease of implementation, lower cost, and increased

reliability. Learn more. http://www.accelacomm.com/jaw/sfnl/114/51425301/


Matplotlib-users mailing list

Matplotlib-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-users

This doesn't look like a leak, it looks like code error. You are
creating unlimited numbers of figures w/o closing the old ones. And
the use of pyplot with GUI code is not supported. You need to use the
"embedding_in*qt*.py approach. See the examples at

http://matplotlib.sourceforge.net/examples/user_interfaces/index.html

···

On Fri, Sep 9, 2011 at 5:04 PM, Matt Earnshaw <matt@...3774...> wrote:

Hi all,

I am encountering a memory leak type issue when running the following,
for example.

http://codepad.org/TNuCLT3k

Matplotlib version: 0.99.3
PyQt4 Version: 4.8.5

I found a thread in the archive relating to this issue which supposedly
disappeared upon updating to PyQt 4.8.4 (I trust it would not have been
reintroduced in going to .5).

Can someone confirm or deny replication of this issue with their setup
and/or offer a solution?

Is it not possible to use imshow() in a Qt application then?

http://matplotlib.sourceforge.net/api/axes_api.html#matplotlib.axes.Axes.imshow

···

On Fri, Sep 16, 2011 at 9:44 AM, Keith Hughitt <keith.hughitt@...287...> wrote:

Is it not possible to use imshow() in a Qt application then?

Yes, it is possible. Everything that is possible in the pyplot
interface is available in the API (the pyplot interface is a thin
wrapper). Most plotting methods from pyplot like plot, semilogx,
imshow, scatter, etc, are axes instances

  ax = fig.add_subplot(111)
  ax.imshow(...)

and the title, xlabel, ylabel, etc, have associated "set_*" methods.

  ax.set_xlabel('some labe').

All of the examples in the API directory follow this pattern

  http://matplotlib.sourceforge.net/examples/api/index.html

and you may want to take a look at the artist tutorial for a deeper
understanding

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

···

On Fri, Sep 16, 2011 at 8:44 AM, Keith Hughitt <keith.hughitt@...287...> wrote:

Is it not possible to use imshow() in a Qt application then?