Skip to content

Commit b388284

Browse files
authored
Update README.md
1 parent 4eee0b7 commit b388284

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,13 @@
22
A QtQuick backend for matplotlib
33

44
Started from maplotlib_qtquick_playground on Frédéric Collonval, but updated to work with the current version (3.2.1) of matplotlib.
5+
6+
## Usage
7+
8+
In order to use matplotlib plots with QtQuick, do the following:
9+
10+
1. In your main.py, use `QtQml.qmlRegisterType` to register `FigureCanvasQtQuickAgg` under whichever name you want to use.
11+
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.
12+
1. One can then pass this object as needed. This is the FigureCanvasQtQuickAgg object. The figure can be found in its `figure` property
13+
14+
Please let me know if you have any suggestions or better ways I should do this.

0 commit comments

Comments
 (0)