Skip to content

Commit 3f62e5a

Browse files
Jovan MitrevskiJovan Mitrevski
authored andcommitted
Merge branch 'master' of github.com:jmitrevs/matplotlib_backend_qtquick
2 parents 2d1d186 + 119b6e3 commit 3f62e5a

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
# matplotlib_backend_qtquick
2-
A QtQuick backend for matplotlib
2+
This package implements a QtQuick backend for matplotlib. It started from [maplotlib_qtquick_playground](https://github.com/fcollonval/matplotlib_qtquick_playground), written by Frédéric Collonval, but it has been updated to work with the current version (3.2.1) of matplotlib.
33

4-
Started from maplotlib_qtquick_playground on Frédéric Collonval, but updated to work with the current version (3.2.1) of matplotlib.
4+
## Usage
5+
6+
In order to use matplotlib plots with QtQuick, do the following:
7+
8+
1. In your main.py, use `QtQml.qmlRegisterType` to register `FigureCanvasQtQuickAgg` under whichever name you want to use.
9+
1. In your QML files, instantiate an object with the QML type defined above. Its `objectName` property specifies the name of the object that can be found in the QML engine. It can be retrieved in python with `win.findChild(QtCore.QObject, "spectFigure")`, for example, where `"spectFigure"` is the `objectName` in this case.
10+
1. One can then pass this object as needed. This is the FigureCanvasQtQuickAgg object. The figure can be found in its `figure` property.
11+
12+
Please let me know if you have any suggestions or better ways I should do this.

0 commit comments

Comments
 (0)