Dear users,
I have been working on a scope based on matplotlib to monitor acquisition
data. In order to enhance frame per seconds, I have used matplotlib's blit
capabilities and works ok. No flickering, nice and smooth. Here's how it's
done, take note that bbox is taken from the figure and not the axes object
in order to make the scale animated. The problem I have, is that the figure
is all white because of this.. just a question of esthetics :-) If bbox is
taken from the axis, the scale will never be drawn. Any suggestion?

# Set all the animated object to animated
self.ax.get_xaxis().set_animated(True)
line = Line2D(tdata,ydata,animated=True)

# Then a copy of the display
background = self.canvas.copy_from_bbox(self.fig.bbox)

# then loop over the acquisition and update
self.ax.set_xlim(tdata[-1] - self.maxt,tdata[-1]) # update axis
self.line.set_data(tdata,ydata) # update line data

self.canvas.restore_region(background) # restore background

self.ax.draw_artist(self.line[0]) # redraw line
self.ax.draw_artist(self.ax.get_xaxis()) # redraw axis
        
self.canvas.blit(self.fig.bbox) # blit

http://old.nabble.com/file/p26635860/acquisition.png 

-- 
View this message in context: 
http://old.nabble.com/animated-axis-tp26635860p26635860.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to