Introduction

This recipe provides a "Fourier Demo" GUI, which is a reimplementation of one of the very first MATLAB GUIs developed at MathWorks in 1993 (right when Handle Graphics was introduced in MATLAB 4). It presents you with two waveforms - a Fourier transform pair - and allows you to manipulate some parameters (via clicking the waveforms and dragging, and controls) and shows how the waveforms are related.

I was very happy about how easily it came together and the performance of the resulting GUI. In particular the matplotlib events and interaction with wx is quite nice. The 'hitlist' of matplotlib figures is very convenient.

What Objects are Involved

This is the main Window of the application, which owns a matplotlib Figure and FigureCanvasWxAgg. It handles mouse interaction (mouseDown, mouseMotion, mouseUp) by registering these methods as callbacks with the canvas.