On Mon, Dec 29, 2008 at 2:04 PM, davev <dve...@lifewaveinc.com> wrote:
> Will do (done actually). Here is the list of files: MyFrame.py HeartPanel.py
> app.py anim.wxg I've included the wxGlade file just to be complete. Please
> let me know if you see anything that is obviously wrong here. It's not much
> different from some of the examples I've looked at but doesn't produce
> similar results. dave

The problem was that you did not call "draw" in your plot init method
before saving the background region.  Unless you are in interactive
mode in pylab, you must manually force a figure draw with a call to
figure.canvas.draw.  Eg, the method should look like::

    def init_plot(self):
        '''
        Method to initialize the plot that is used to animate the display.
        '''
        self.figure.subplots_adjust(left=0, top=1, right=1, bottom=0)
        self.axes = self.figure.add_subplot(111)
        self.axes.set_axis_bgcolor('black')
        self.figure.canvas.draw()
        if self.bgnd == None:
            self.bgnd = self.canvas.copy_from_bbox(self.axes.bbox)

        self.x_data = num.arange(0, 2*num.pi, 0.01)
        self.line = self.axes.plot(self.x_data, \
                                   num.sin(self.x_data), \
                                   color='green', \
                                   figure=self.figure, \
                                   lw=2, \
                                   animated=True)
        self.axes.hold(False)


I was able to run your example, and with these changes it works as expected.

JDH

------------------------------------------------------------------------------
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to