Python Forum
Architecting Efficient Plot - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Data Science (https://python-forum.io/forum-44.html)
+--- Thread: Architecting Efficient Plot (/thread-31791.html)



Architecting Efficient Plot - blipton - Jan-03-2021

Trying to conceptually think of good way to update a matplotlib plot with data that comes from the serial port.

I have one (multi)process that is waiting for serial data to come in (randomly every 10ms-10sec), and then I call my matplotlib draw function, but the figure window is totally unresponsive (i.e. hourglass) in between updates. Even though I thought matplotlib runs in its own thread (like pyqtgraph).

What's the preferred method.. should I create another process and have the serial process pushes data to it (via a queue), and then have that process call the matplotlib draw function? Or should I use threads instead of multiprocess?