问题
I have developed a Qt GUI using Qt4 and PyQt. I am trying to implement a graph that will dynamically "live update" the graph to represent the rate at which the data is being transmitted in a (data/sec format). However, the problem lies within implementing a graph that can cleanly live update, not finding the speed. Any suggestions would be greatly appreciated. For the record, I want this to be built in as a widget within the GUI not a separate pop-up window.
Regards,
sudo!!
回答1:
I suggest you to use two threads: One for acquiring data from somewhere, the other for representing it's graphics. You can take a look on A “live” data monitor with Python, PyQt and PySerial or to pyQt Matplotlib widget live data updates.
回答2:
I've used qCustomPlot (website here) with pretty good success. I can live-update several thousand data points and it's all very straightforward to use.
来源:https://stackoverflow.com/questions/24307521/a-dynamically-updating-graph-for-pyqt-gui