Wednesday, August 26, 2009

Multidimensional Data Visualization in Python - Mixing Chaco and Mayavi

In a previous post, I recreated an infographic using the Chaco plotting library. Inspired by Peter Wang's lightning talk (scroll to about 5:15 in the video) at the recent SciPy Conference, I've extended this idea a bit to show the exploration of a "4D" data set (three axes and the color/size of the points) and using a 5th dimension (the date) as an interactive filter.

Since it's a whole lot easier to demonstrate than to describe, I made a short screencast of me playing with it:


While a bit hackish, the code is available for anyone wishing to play with or improve it.

I know I've said this before, but it bears repeating -- Mayavi is awesome.


  1. This is a slick demo and it looks quite responsive. How much data do you have? Have you tested to see how much data is required to bog it down?

  2. The video capture software I used makes things speed up a bit ;), but it is quite responsive. There are 963 points in this data set. It really helps to use the mayavi filters rather than trying to filter things 'manually' by changing the underlying numpy array and calling update_data(). Looking at the code again, it looks like I may be making some redundant update calls anyway, so it may be possible to tweak it further. It's still very usable as it is -- and all in under 200 lines, including comments. Those Enthought tools are really nice.