Hello, I want a real-time animation. There is no loop in the animation because the data comes from the real world (AD data). I wrote this class:
class Eigendiagramm(object): def __init__(self,daten): self.DiagrammBreite = gtk.Adjustment(100,20,10000,1,10,10) self.DiagrammBreiteWidget = gtk.VScale(self.DiagrammBreite) self.DiagrammBreiteWidget.connect("value_changed", self.updateBreite, None) self.data = daten self.fig = Figure() self.fig.set_animated(True) self.graph = self.fig.add_subplot(111) self.line, = self.graph.plot(self.data.get_ekg_data(),) self.graph.axis([0, self.DiagrammBreite.get_value(), 0, 4096]) self.canvas = FigureCanvas(self.fig) self.DiagrammBreite = gtk.Adjustment(100,20,10000,1,10,10) self.DiagrammBreiteWidget = gtk.VScale(self.DiagrammBreite) self.DiagrammBreiteWidget.connect("value_changed", self.updateBreite, None) def updateGraph(self,data): datacut = data[10000 - self.DiagrammBreite.get_value():10000] self.line.set_ydata(datacut) self.line.set_xdata(numpy.arange(0, datacut.size, 1)) self.fig.canvas.draw() def updateBreite(self,widget, data = None): self.graph.axis([0, self.DiagrammBreite.get_value(), 0, 4096]) It works but it is very slow. (About 160mS for updateGraph when I have two graphs) Is there any possibility to improve the performance? I embedded the figure in GTK. I looked to animation examples but every example there is a loop. So I don't know how to use this class for my problem. Peter ------------------------------------------------------------------------------ Introducing Performance Central, a new site from SourceForge and AppDynamics. Performance Central is your source for news, insights, analysis and resources for efficient Application Performance Management. Visit us today! http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users