Python Bindings for Qwt

Gerard Vermeulen

This document describes a set of Python bindings for the Qwt widget set featuring fast plotting of lists, tuples and Numerical Python (NumPy) arrays. Address questions and bug reports to Gerard Vermeulen.


Table of Contents
Introduction
Installation
qwt Module Reference

Introduction

PyQwt is a set of Python bindings for the Qwt (Qt Widgets for Technics) toolkit, featuring fast plotting of NumPy arrays (and Python lists or tuples) of Python floats.

NumPy

The Numerical Python Extensions (a.k.a NumPy or Numeric) turn Python in an ideal language for experimental numerical and scientific computing (MatLab-like, but better). NumPy defines a new data type "array" and a very complete of operators and functions to manipulate NumPy arrays. Look at the following simple example:
[packer@voyager PyQwt]$ python
Python 2.1 (#1, Apr 29 2001, 11:41:38) 
[GCC 2.95.3 19991030 (prerelease)] on linux2
Type "copyright", "credits" or "license" for more information.
>>> from Numeric import *
>>> from arrayfns import *
>>> x = span(0, 9, 4)
>>> y = sin(x)
>>> x
array([ 0.,  3.,  6.,  9.])
>>> y
array([ 0.        ,  0.14112001, -0.2794155 ,  0.41211849])
>>> sqrt(x)
array([ 0.        ,  1.73205081,  2.44948974,  3.        ])
>>> x*x
array([  0.,   9.,  36.,  81.])
>>> 
The function call "span(0, 9, 4)" returns a NumPy array of 4 equidistant points from 0 to 9 inclusive: "array([ 0., 3., 6., 9.])". The function call "sin(x)" and statement "x*x" show that "sin" and "*" manipulate NumPy arrays element by element. All this in C, for a manyfold speedup with respect to pure Python.

Qwt

Qwt is an extension to the Qt GUI library from Troll Tech AS. The Qwt library contains widgets and components which are primarily useful for technical and scientifical purposes. It includes a 2-D plotting widget, different kinds of sliders, and much more.