Dear Matplotlib-users, I have now been struggling with
> getting matplotlib integrated into a PyQt based GUI
> environment. The example
> embedding_in_qt.py
> which comes with the source distribution, has been my
> starting point.
> The problem is that in my own applications, matplotlib has
> to serve the purpose of showing animated data; and for some
> reason, I cannot squeeze more than 10-15 FPS out of the
> example. The QTimer in the example is set to 10 ms, so this
> is not the problem.
The wiki page at
http://www.scipy.org/Wiki/Cookbook/Matplotlib/Animations
discusses animation techniques with performance in mind.
Unfortunately, the techniques described at the end in the section on
blitting and drawing selected artists are not currently available for
QtAgg. Basically, there are three methods that need to be implemented
in the qt backend (the three are discussed in the web page above
towards the end). Basically they involve saving and copying selected
regions of the agg renderering buffer to and from the qt canvas.
There are examples in the GTKAgg, WXAgg, and TkAgg backends for you
follow, so if you know something about Qt and want to get much better
performance for animation, perhaps you can implement these for the
QtAgg backend and send them our way when you are done
In any case, it is on our list of things to do...
JDH
If you can provide a few pointers to the relevant files in the matplotlib
source, I'll have a look and see what I can do.
// Mads
···
On Tue, 21 Mar 2006, John Hunter wrote:
> Dear Matplotlib-users, I have now been struggling with
> getting matplotlib integrated into a PyQt based GUI
> environment. The example
> embedding_in_qt.py
> which comes with the source distribution, has been my
> starting point.
> The problem is that in my own applications, matplotlib has
> to serve the purpose of showing animated data; and for some
> reason, I cannot squeeze more than 10-15 FPS out of the
> example. The QTimer in the example is set to 10 ms, so this
> is not the problem.
The wiki page at
http://www.scipy.org/Wiki/Cookbook/Matplotlib/Animations
discusses animation techniques with performance in mind.
Unfortunately, the techniques described at the end in the section on
blitting and drawing selected artists are not currently available for
QtAgg. Basically, there are three methods that need to be implemented
in the qt backend (the three are discussed in the web page above
towards the end). Basically they involve saving and copying selected
regions of the agg renderering buffer to and from the qt canvas.
There are examples in the GTKAgg, WXAgg, and TkAgg backends for you
follow, so if you know something about Qt and want to get much better
performance for animation, perhaps you can implement these for the
QtAgg backend and send them our way when you are done
In any case, it is on our list of things to do...
JDH