Discussion:
[Matplotlib-users] canvas.draw() memory issue? (PyQt4)
Matt Earnshaw
2011-09-09 22:04:40 UTC
Permalink
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
Keith Hughitt
2011-09-15 14:54:26 UTC
Permalink
Confirmed with:

PyQt4 4.8.3
Matplotlib 1.1.0

Not sure what the cause is though.
Keith
Post by Matt Earnshaw
Hi all,
I am encountering a memory leak type issue when running the following,
for example.
http://codepad.o rrg/TNuCLT3k <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
------------------------------------------------------------------------------
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
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
John Hunter
2011-09-15 15:11:41 UTC
Permalink
Post by Matt Earnshaw
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?
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
Keith Hughitt
2011-09-16 13:44:54 UTC
Permalink
Is it not possible to use imshow() in a Qt application then?
Darren Dale
2011-09-16 14:21:45 UTC
Permalink
Post by Keith Hughitt
Is it not possible to use imshow() in a Qt application then?
http://matplotlib.sourceforge.net/api/axes_api.html#matplotlib.axes.Axes.imshow
John Hunter
2011-09-16 17:33:16 UTC
Permalink
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
Post by Keith Hughitt
Is it not possible to use imshow() in a Qt application then?
Loading...