plot performance for help

You can figure out how much time is involved on the front side matplotlib
by using the null backend Template:

   import matplotlib
   matplotlib.use('Template')

This will give you an upper limit on your performance since none of the
rendering costs are shown. If that is already down to e.g., 30 fps then
you will not see anything better from an opengl backend.

Speed improvements in the matplotlib front end may be possible, for
example by representing tics and grids as line collections rather than
rendering each one with a separate path command.

  - Paul

···

On Mon, Sep 01, 2008 at 12:06:45AM -0700, Kevinsysu wrote:

Hi all:

I'm using matplotlib for plotting in recent days. I love it especially the
usability and the plot quality.

My current work is to display a real time data set update into several 2D
graphs (5 or more, 400x400 graphs).
The environment I'm using is:
wxpython 2.8.8.1
matplotlib 0.98.3
python 2.5.1.1
Intel P IV 2.4G
Using the wxagg backend.

The issue I encoutered was that the graphs refresh took too much CPU time,
or in other word, the graph is not draw fast enough.
Sorry to raise this performance topic again, as I knew you've discussed a
lot on this topic, there're also some posts related to this, but I just
can't find a solution suite to me.

For single graph sized 400x400, my target is to reach 50 fps. Actually, it
can be easily achieved using the animation method: copy_from_bbox/
restore_region in the following link.
http://www.scipy.org/Cookbook/Matplotlib/Animations. (I reach 90+ fps with
this) The difficulty I got is that the above method is only updating the
bbox area, but I have to update the x/y axis as well. As John indicated in
another post, updating the x/y axis is the bottleneck of the draw process.
When I update the x/y axis at the same time, the performance drops to 20+
fps, which is lower than my requirement.

Below are my questions, any kind of answer or hints would be appreciated:
1. Can I reach the performance requirement by using the wxagg? If yes, how
can I get there?
2. Is there any existing backend can reach the performance requirement? Can
it be embedded with wxpython?
3. What differences (especially performance aspect) between the wxagg and
agg backend?
4. As I know, in the recent post, Paul Kienzle is planning to develop the
opengl backend. Could the opengl backend have a great improvement on
performance compare with the wxagg?

I think the big win here would be for us to write a light-weight axis
support which doesn't have all the features of the default axis but is
fast. Eg, it would not support all the various alignment and
rotations for ticklabels (eg, all xtick labels would be horizontally
aligned center and top aligned vertical) and would have homogeneous
font properties (don't create a bunch of Text instances, just call
draw_text repeatedly with the labels. We could drop the locators and
formatters and mathtext and all that, and make the user responsible
for setting the locations and label strings. We would not have
separate objects for each tick, but just draw all the markers in the
right places using a single plot command with linestyle TICK_LEFT,
etc.). This would probably be fast enough for most quasi-realtime
plots.

I think one could use Michael's projection registry to support this
kind of thing, even though it is not a projection the infrastructure
could be used to support pluggable axis support. This is on my TODO
list, but I probably cannot get to it right away.

JDH

···

On Tue, Sep 2, 2008 at 10:40 AM, Paul Kienzle <pkienzle@...537...> wrote:

Speed improvements in the matplotlib front end may be possible, for
example by representing tics and grids as line collections rather than
rendering each one with a separate path command.