roi = pg.PolyLineROI([[50, 10],[50,50],[70,50]], pen=pg.mkPen('b'), closed=True)
In my case, I started out with matplotlib, but had to switch over to pyqtgraph due to a need for realtime interactivity with large amounts of data. I found matplotlib to be unusably slow for this. So sure pyqtgraph has its weaknesses, but for some people (like me), it's indispensable.Comparison to other python graphics packages:
Matplotlib is more or less the de-facto standard plotting library for python. If you are starting a new project and do not need any of the features specifically provided by pyqtgraph, you should start with matplotlib. It is much more mature, has an enormous user community, and produces very nice publication-quality graphics.Reasons you might want to use pyqtgraph instead:
- Speed. If you are doing anything requiring rapid plot updates, video, or realtime interactivity, matplotlib is not the best choice. This is (in my opinion) matplotlib's greatest weakness.
- Portability / ease of installation. PyQtGraph is a pure-python package, which means that it runs on virtually every platform supported by numpy and PyQt, no compiling required. If you require portability in your application, this can make your life a lot easier.
- Many other features--pyqtgraph is much more than a plotting library; it strives to cover many aspects of science/engineering application development with more advanced features like its ImageView and ScatterPlotWidget analysis tools, ROI-based data slicing, parameter trees, flowcharts, multiprocessing, and more.