mlpyqtgraph enables matplotlib-like plotting with
pyqtgraph in existing python programs.
It relies on pqthreads to separate mlpyqtgraph's plotting functionality from the existing python program, by separating them in different Qthread
s.
Checkout the documentation's introduction for more background information.
First, install mlpyqtgraph like any other python package using pip
:
pip install mlpyqtgraph
Detailed installation instructions are found in the documentation.
To use mlpyqtgraph, decorate your main function with mlpyqtgraph's plotter
decorator. This diverts the existing python program into a dedicated thread,
while using the main thread solely for plotting with pyqtgraph.
Now you can use mlpyqtgraph's plot functionalities inside your decorated function. A python program that shows a very basic plot could look like this:
import mlpyqtgraph as mpg
@mpg.plotter
def main():
""" Minimal mlpyqtgraph example """
mpg.plot(range(5), (1, 3, 2, 0, 5))
if __name__ == '__main__':
main()
Please refer to the examples for a few applications of mlpyqtgraph.
Check out the documentation! Please note that it's currently still under construction.
This repository comes with pre-commit hooks, which are stored in
.hooks
. To enable the hooks issue:
git config --local core.hooksPath .hooks/
An MIT style license applies for mlpyqtgraph, see the LICENSE file for more details.