PyQtGraph is a library for creating plots in PyQt applications. Recent changes in Python 3.8 can cause problems if you're using older versions of PyQtGraph.
I got an error when running your plotting script above at line
from pyqtgraph import PlotWidget, plot, which gave the error
Exception has occurred: AttributeError module 'time' has no attribute 'clock'
clock member was removed from the
time module in Python 3.8. In your own code this can be
replaced with either
time.process_time() instead, depending on your requirements. For libraries such as PyQtGraph you'll need to wait for them to be updated.
This was fixed in PyQtGraph v0.11.0rc0 and is available via PyPi.
In future, if you need to access the latest versions of PyQtGraph before release, you can also install the current master from Github directly.
pip install git+https://github.com/pyqtgraph/pyqtgraph.git
Alternatively, you can downgrade to Python 3.7 in the meantime.