[SciPy-user] Flicker image plotting

eric eric at scipy.org
Sat Feb 23 14:22:53 CST 2002


I'm guessing you can just change the plot_canvas.draw method around line 403 in
scipy/plt/wxplt to use a MemoryDC instead of the client DC.

Here is the method.

   def draw(self,dc=None):
        #if not len(self.line_list) or len(self.image_list):
        #    return
        # resize if necessary
        #print 'draw'
        t1 = time.clock();self.reset_size(dc);t2 = time.clock()
        #print 'resize:',t2 - t1
        if not dc: dc = wx.wxClientDC(self)
        # draw titles and axes labels
        t1 = time.clock()
        for text in self.all_titles:
            text.draw(dc)
        for axis in self.axes:
            axis.draw_labels(dc)
        t2 = time.clock()
        #print 'text:',t2 - t1
        self.draw_graph_area(dc)

Take note that the plotting effort will resume in a different direction very
soon.  However, I expect wxplt will still be around for a while, so, if it
doesn't take much effort, it is a worthwhile addition.

eric

----- Original Message -----
From: "Andrew M. Henshaw" <andrew.henshaw at mail.com>
To: <scipy-user at scipy.org>
Sent: Saturday, February 23, 2002 4:01 PM
Subject: RE: [SciPy-user] Flicker image plotting


> I'll look at this.  I've done this before with a few Win32-based programs, but
I didn't want to go off on a wild goose chase, if it was already implemented.
>
> Thanks to both of you.
>
> Andy
>
> -----Original Message-----
> From: scipy-user-admin at scipy.org [mailto:scipy-user-admin at scipy.org]On
> Behalf Of eric
> Sent: Saturday, February 23, 2002 1:29 PM
> To: scipy-user at scipy.org
> Subject: Re: [SciPy-user] Flicker image plotting
>
>
> Hey Andrew,
>
> I haven't looked at this, but bet you could use the trick Bryan suggests.
> However, wxplt started with real-time plotting in mind, but that quickly fell
by
> the way side.  As such, I doubt the frame rate will be so hot.
>
> Still, it might be worth trying because Bryan's suggestion isn't that hard to
> implement.  If someone ends up with a patch, send it my way and I'll take a
look
> at adding it to the distribution.
>
> see ya,
> eric
>
> > I'm not sure how much effort would be to fix this in SciPy as I don't
> > use SciPy much, but I have modified the wxPlotCanvas which comes with
> > wxPython, to be flicker-free (plus a few other mods). I use this for
> > real-time data display (line plots and colour-maps).
> >
> >  You simply draw everything to a an image held in memory (a MemoryDC)
> > then copy this to the screen (with the Blit function - very fast).
> >
> > Bryan
> >
> >
> >
> > On Sat, 2002-02-23 at 02:26, Andrew M. Henshaw wrote:
> > > Is there some mechanism for double-buffering image plots so that they
don't
> flicker when a series of image arrays is generated?
> > > _______________________________________________
> > > SciPy-user mailing list
> > > SciPy-user at scipy.net
> > > http://www.scipy.net/mailman/listinfo/scipy-user
> > --
> > Bryan Cole
> > Teraview Ltd., 302-304 Cambridge Science Park, Milton Road, Cambridge
> > CB4 0WG, United Kingdom.
> > tel: +44 (1223) 435380 / 435386 (direct-dial) fax: +44 (1223) 435382
> >
> > _______________________________________________
> > SciPy-user mailing list
> > SciPy-user at scipy.net
> > http://www.scipy.net/mailman/listinfo/scipy-user
> >
>
>
> _______________________________________________
> SciPy-user mailing list
> SciPy-user at scipy.net
> http://www.scipy.net/mailman/listinfo/scipy-user
> _______________________________________________
> SciPy-user mailing list
> SciPy-user at scipy.net
> http://www.scipy.net/mailman/listinfo/scipy-user
>





More information about the SciPy-user mailing list