dynamic plots

This trick here is that the binary format of a wxBitmap is

    > both platform and instance dependent. The idea, as I
    > understand it, is that a wxBitmap has the same binary
    > format as is needed for the current display, so each
    > platform is different, and it can also be different
    > depending on the depth of the display. Given all this, I
    > doubt you're going to be able to improve on the wx supplied
    > methods for converting from a wxImage to a wxBitmap. (and
    > if you do, contribute it to wx!)

But this might helpful - if we can detect what kind of binary format
wx is using, we can ask agg to convert itself to this format in a
python buffer object and pass this on directly to the wxBitmap. Agg
has efficient conversion routines from just about any pixel format to
any other. This would avoid one copy, because we could do (making up
the syntax for copying a buffer into the bitmap

        if display_format=='ZZZ': # made up pixel format
           buffer = self.to_zzz()
           self.bitmap.UpdateFromBuffer(buffer) # made up method
        else: # fall back on old method
            s = self.tostring_rgb()
            w = int(self.renderer.width)
            h = int(self.renderer.height)
            image = wxEmptyImage(w,h)
            self.bitmap = image.ConvertToBitmap()

If we could handle the most common cases, it would be a win for most
users. Any idea how to query the pixel format of the wx display?

    > Does the Agg backend use a binary format compatible with
    > wxImage? If not, that means there are two conversions
    > required, which might be the source of the slowdown.

agg uses an array of unsigned chars r0, b0, g0, a0, r1, b1, g1, a1,

What does wxImage use?