Discussion:
real time data plots with fixed axes, use of invalidate()
Ozgun Karagil
2013-03-18 17:03:29 UTC
Permalink
Hello,

I am using guiqwt to display real time graphs and provide some setup
variables. Have to say it's a great tool and the learning curve was quite
flat.

The speed of graph updates looks quite good with the replot() method, at
least it is sufficient for our needs. But I wondered what I have missed
when I used the invalidate() method call, since the documentation suggested
that this was a faster way to refresh graphs with no axis changes


Easiest way to test this was to use filtertest2.py in the examples, and add
a QTimer events to force further filtering the signal:


class FilterTestWidget(QWidget):
def setup_widget(self, title):
...
self.timer = QTimer(self)
self.timer.timeout.connect(self.update_canvas)
self.timer.start(10)

...
* def update_canvas(self): *
*self.y = self.func(self.y) *
* self.curve_item.set_data(self.x, self.y) #modify data*

self.plot.invalidate() #was hoping this line alone would force
redrawing the plot
self.plot.replot() # without replot, the canvas only gets
updated on window events (moving, mouse clicks, loosing focus etc...)


Best regards,
Ozgun Karagil



PS: Source code for

class BasePlot(QwtPlot):
....
def invalidate(self):
* """Invalidate paint cache and schedule redraw*
* use instead of replot when only the content*
* of the canvas needs redrawing (axes, shouldn't change)*
* """*
self.canvas().invalidatePaintCache()
self.repaint()
--
You received this message because you are subscribed to the Google Groups "guidata/guiqwt" group.
To unsubscribe from this group and stop receiving emails from it, send an email to guidata_guiqwt+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Loading...