There is lack of other files and directory you uses so it can't be reproduced, but you could try that instead of *.clear()* use *.setData(*...*, clear=True)*. Also try to add *QtGui.QApplication.processEvents()* in your update function, or make new QTimer with lower value, just for a new function with *QtGui.QApplication.processEvents()*.
On Thu, Jun 23, 2016 at 2:20 AM, Jason Mar <[email protected]> wrote: > I'm currently working on a real time display system using > pyqtgraph/anaconda3 and I'm having trouble optimizing the code to not clog > the cpu. I'm currently plotting 600 points at all times * 2 sets of data > per plot * 21 plots of data which is roughly 25000 points at all times. The > code struggles to handle that many points (it crashes at 500s due to cpu > maxing out at 100% running this code alone) and I'm willing to cut it to > 300 points of data per dataset (5 minutes of real time data which is barely > meeting our purpose of analyzing real time data), but even plotting 300 > points clogs up ~60% of our cpu on an industrial computer which is not > optimal since we're running other software at the same time (this code if > possible can only take up ~20% of our cpu). This code reads data from > another program that's processing the data, but for testing purposes a > dummy file is being uses to simulate it. > > So I'm hoping that instead of redrawing the whole plot from scratch, > there's an alternative to 'append' new points to an already drawn graph and > only have to redraw the plot every 10 secs instead of every second (which > is how often I receive new data). Y axis - data, X axis - time(seconds). > > If that's confusing I'm hoping for > 0 - > 300 points hopefully being appended to avoid cpu clogging > > when 300 points is plotted -> clear() -> plot the last 290 points and > append the next 10 values > > repeat until program ends. > > Any advice / alternatives will be much appreciated. I've attached my code > for reference. > > -- > You received this message because you are subscribed to the Google Groups > "pyqtgraph" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/pyqtgraph/027fac66-26ce-4e70-a198-f3cec1be25dc%40googlegroups.com > <https://groups.google.com/d/msgid/pyqtgraph/027fac66-26ce-4e70-a198-f3cec1be25dc%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "pyqtgraph" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/pyqtgraph/CAD_qyJqobPdQRhKXtK_kxwHzgCgeeniuU0MEyFhSjgdders9Pw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
