2

I want to write simple GUI tools for new hardware developed in my company. I need to use python because my company uses a lot of old libraries. My idea is now to use Python and PyQt to write the application and use pyinstaller to deploy it to other colleagues (installing python everywhere is not what we want). It works pretty good so far, but when i try to use plotting libraries, as for instance PyQwt, the size of the executable increases from approximediatly 15MB to 120MB. I found out that this is because PyQwt supports NumPy. However, I don't need NumPy for my projects.

I found a couple of plotting tools as for instance: PyQwt, Matplotlib, PyQtGraph However, all of them use Numpy.

My question is: Is there a plotting tool or framework for PyQt/PySide that does not require Numpy?

What I need to plot is simple sequential data. For instance a sensor delivers a temperature every second and I want to see the last 20 temperatures in a y/t diagram.

Idealy a PyQwt without numpy. The PyQwt homepage says NumPy is optional. Is it eventually possible to configure PyInstaller in a way to skip numpy?

Thank you very much for your help!

My System: Windows 7 PythonXY 2.7.10 PyQT4

Iron Fist
  • 10,739
  • 2
  • 18
  • 34
  • Yes, many of the plotting libraries use numpy. You may want to also look into using a python micro-web framework like flask to handle your business logic and design the gui as an in-browser web app. Javascript graphing libraries are far prettier and interactive than anything in python. – Brendan Abel Jan 08 '16 at 08:25

1 Answers1

2

Looking at the documentation, down to 3.Fine Tune (Optional):

to the configure.py options.

The configure.py script takes many options. The command:

python configure.py -h

displays a full list of the available options

Then looking at those options, I can see how to disable Numpy:

Detection options:

--disable-numarray  disable detection and use of numarray [default
                    enabled]
--disable-numeric   disable detection and use of Numeric [default enabled]
--disable-numpy     disable detection and use of NumPy [default enabled]

So, if you run the following command while you are at the PyQwt directory, you will be able to disable Numpy:

$:python configure.h --disable-numarray

If your requirement is to only plot simple sequential data, like sensor reading versus time, I suggest to you PyQtGraph and an example of real time plotting.

A generic example:

import pyqtgraph as pg
pw = pg.PlotWidget(name='My Graph')
horizontalLayout_Plot.addWidget(pw)
x,y = range(10),range(10)
pw.plot(x,y)
Community
  • 1
  • 1
Iron Fist
  • 10,739
  • 2
  • 18
  • 34
  • Could you clarify in your post why you recommend pyqtgraph for "real time" plotting? Matplotlib is capable of this too. I've never pyqtgraph so I'm curious. – Oliver Jan 09 '16 at 19:44
  • @Schollii .. Simply because I need in my software something to plot with which should be as simple as it can, and I found `pyqtgraph` very easy to use. I didn't have to disable anything option to avoid `numpy`...or anything else. – Iron Fist Jan 11 '16 at 08:58
  • Thx. So basically because the learning curve and configuration are simpler. What about speed when there are lots of points? – Oliver Jan 11 '16 at 21:39
  • Sorry for beeing late, i needed to work on a different project the last days. I tried a simple test programm with pyqtgraph which works good, but when I try to make an executable out of it using pyinstaller the size is still around 100 MB. Today I tried to compile PyQWT without numpy as you said. However, it is way more difficult than i thought, because there is a version conflict: see [link](http://vogelchr.blogspot.co.at/2014/08/building-pyqwt-520-by-manually.html). Is there any precompiled version of PyQwt without Numpy? @IronFist – Florian Strasser Jan 27 '16 at 16:19