Deployment

Here’re three ways to deploy mpl4qt to the operating system, although these approaches are only tested on Linux, hopefully, still work (not tested) on Windows and Mac OS.

Prerequisites

Required packages: Qt5-designer, pyuic5, numpy, matplotlib.

Normally, all of the Python dependencies will be installed automatically. Recently, there is one issue regarding starting up Qt designer, see here, so it is recommended to use the PyQt5 coming with the OS distribution, e.g. if you’re running Ubuntu/Debian/Linux Mint, just install the following packages:

sudo apt-get update
sudo apt-get install python3-pyqt5 qttools5-dev-tools pyqt5-dev-tools

Install via PIP

See this link about installing pip.

Install mpl4qt:

pip install mpl4qt

Or upgrade from an earlier version by (use --no-deps if only updating mpl4qt):

pip install mpl4qt --upgrade --no-deps

Install from Source

Clone the source from Github:

git clone https://github.com/archman/mpl4qt.git

Then check out to master branch (normally you’re already there), and install into your system by:

python3 setup.py install

After Installation

What could be reached out?

  • Command: run_designer to start Qt5-designer with matplotlib widgets integration.

  • Command: mplcurve_default_settings to generate the JSON file for the default configuration of MatplotlibCurveWidget.

  • List of widgets are available in Qt designer:

    • MatplotlibCurveWidget

    • MatplotlibErrorbarWidget

  • Python package named mpl4qt to be ready for use in any Python script.

Development Environment

  • Python: 3.5.2

  • matplotlib: 2.2.3

  • numpy: 1.14.5

  • Qt: 5.5.1

  • PyQt: 5.5.1

Qt/PyQt versions could be checked by:

from PyQt5.QtCore import QT_VERSION_STR, PYQT_VERSION_STR

print(QT_VERSION_STR, PYQT_VERSION_STR)

Simple Demo Apps

Simple applications created with mpl4qt package could be running by:

python -m mpl4qt.examples.app1
python -m mpl4qt.examples.app2

The former is built with MatplotlibCurveWidget and the latter is with MatplotlibErrorbarWidget.