Typing
import pyqtgraph as pg
pg.plot([1,2,3,2,3])
into the standard Python REPL opens a window containing a plot of the data. Typing exactly the same code into the IPython REPL or the Jupyter console, opens no such window.
[The window can be made to appear by typing pg.QtGui.QApplication.exec_()
, but then the REPL is blocked.
Alternatively, the window appears when an attempt is made to exit the REPL, and confirmation is being required.
Both of these are highly unsatisfactory.]
How can basic interactive pyqtgraph plotting be made to work with the IPython REPL?
[The described behaviour was observed in IPython 5.1.0 and Jupyter 5.0.0 with Python 3.5 and 3.6 and PyQt4 and PyQt5 (no PySide)]