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
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?
This worked for me:
to remove axis temporary and than to take background of the whole picture
but without ticks and labels of this axis:
This worked for me:
to remove axis temporary and than to take background of the whole picture
but without ticks and labels of this axis:
This suggestion did not resolve the problem.
But here is the solution. I have no idea why the first version is not
working.
I changed the threading technique:
- from gobject.idle_add(run) to the fig.canvas.mpl_connect('draw_event',
start_anim)
I think it can be only that... Any ideas?
import matplotlib
matplotlib.use('GTKAgg')
from pylab import figure, show
import gobject, gtk
import time