Peformance improvements when plotting large amounts of data

340 views
Skip to first unread message

Michael Rose

unread,
May 12, 2021, 10:13:26 AM5/12/21
to pyqtgraph
I've been using pyqtgraph for a few months now while developing a data analysis tool and I've run into an issue recently that I haven't been able to solve.

When I plot data that looks like this:
plotting_slowness.png

Then my application basically freezes. The data being plotted is switching between 0 & 1 at every other data point, but at this scale looks like a solid block of red. This causes things to slow down (or effectively halt).

If I zoom in on the data (which looks like this):
plotting_zoom_in_works.png

Then the application becomes responsive again. And if I plot a signal like this (zoomed at the same scale as the first image):
plotting_this_signal_works.png
which has the same number of data points as the other signal, then the application is responsive, so it isn't an issue with the quantity of data, but with the way the data is being drawn (I believe).

Any hints/suggestions as to what might cause this?

Ognyan Moore

unread,
May 12, 2021, 11:28:10 AM5/12/21
to pyqt...@googlegroups.com
Hi Michael,

It's tough to say what's happening from the screenshots alone.  Are you using any of the downsampling options or using the clipToView?  Would you be able to share the code you're using to generate the plots and serialize the data used, I wouldn'T mind trying to take a closer look.

Ogi

--
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 pyqtgraph+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyqtgraph/b73b7e53-ca67-476d-863d-4e1b0f3aac23n%40googlegroups.com.

Michael Rose

unread,
May 15, 2021, 2:13:01 PM5/15/21
to pyqtgraph
Hey, thanks for being willing to look into this for me. I have not tried any of the downsampling options, but can certainly give that a try. I'm not able to share the full source of my application, but I have a simpler version that I've used to reproduce the issue.  You can find the code here:



When doing so, you should see this GUI:
plotting_gui.png

You can drag the variables from the list on the left onto the plot on the right and their values will be displayed. When plotting any variable but "var4", the GUI remains responsive. Then when trying to plot var4 (which contains similar data to my original post) the GUI becomes unresponsive. Also, probably important, I'm currently running the following environment:
  • Linux (Ubuntu 18.04)
  • Python 3.7.10
  • Qt 5.12.9
  • PyQt 5.12.3
  • pyqtgraph 0.12.1
Let me know if you have issues running the example or need any additional environment info.
Reply all
Reply to author
Forward
0 new messages