Data Visualization in Octave using Tk widgets

NOTE This page describes our toolkit from around 2005. In the intervening time, the Tcl/Tk/Blt tooling has somehow stagnated, while the Python ecosystem gained great momentum, so we substantially switched to the combination of Python, NumPy and MatPlotLib. While Octave is still very useful and hard to replace, we recommend Python for future work.

Here are some pictures from our Tk/Octave project: importing Tcl/Tk GUI environment into Octave. We prefer that to building a native GUI capabilities, because, besides the usual GUI widget set, we can leverage the existing Tcl extensions, such as

We have started from the TkOctave by Joao Cardoso; we have reimplemented it so that it runs the octave interpreter and the Tk interpreter as two threads of the same process. The advantage of this approach is that we don't need to go through disk or pipes to pass data and commands back and forth; this results in very nice interactive speeds, indeed.

This is an ongoing project; we have considered or played with different inter-thread communication mechanisms: shared memory, pipes, common (thread) address space, RPC mechanisms such as RPC, Corba, .NET; and finally network sockets. All of those have advantages and disadvantages, both in terms of performance and in terms of portability.

If you are interested in this work, please contact pkienzle@nist.gov or przemek@nist.gov.

Here's an image display widget that imports an octave array (and possibly another array to serve as a colormap), and displays it alongside an X- and Y-axis cut. It allows zooming into the image, and cursor tracking with live updates of the X/Y cut plots, at interactive speeds (our test array is 400x400 elements):

This image shows the zoomed view:

The only custom part in this widget is the code to grab an octave array and pass it to Tcl. Everything else was done entirely in just 200 lines of Tcl, using the existing BLT widget for displaying the axis, X/Y graphs and colormap index.

BTW, this mechanism can be seen both as a GUI for octave programs (i.e. a way to create a GUI from within octave code), as well as a GUI for octave itself (by creating an appropriate text input and result display widgets in, say, .octaverc).

Here's an example of a VTK window created from within Octave's Tcl interpreter. The main interface window shows the sample data in 2D:



An additional window is provided for entering Octave commands. Pressing the 'Render' button brings up a VTK window with a 3D representation:


Some feedback given at the command prompt: