hello, world of statistical graphics in IPython notebook

A few months ago, I had great success invoking the internet to come up with the “hello, world” of statistical graphics.

There are some exciting new developments in javascript-based plotting, and this graphic is just the thing to compare them. D3js has conquered the world in recent years, and is something that my colleagues are starting to think they need to know. Meanwhile, one of the d3js instigators has unveiled the next in his series of revolutions in data visualization, Vega. This is still in development, but may be more appropriate than d3js for routine plots. And it was very soon after the Vega specification and runtime appeared that a python package for it was also released.

Here is an IPython notebook comparing all of these options. The notebook doesn’t save javascript in a way that redisplays, but if you put it in your own notebook server and execute all the cells you should see something like this:


p.s. google vincent vega to learn the pop culture joke behind this strangely named python package.


Filed under software engineering

2 responses to “hello, world of statistical graphics in IPython notebook

  1. Having trouble with the javascript magics on 0.13.2.

    “ERROR: Cell magic function `%%javascript` not found.”

    any ideas? I’m really interested in this topic and would like to see the side-by-side.

  2. Maybe it is an IPython version issue. I’m using a nearly up-to-date version of the version here: https://github.com/ipython/ipython

    If you don’t have %%javascript magic, you can try wrapping the cell contents with Javascript(""""""), which also works for me.