Tag Archives: ipython

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:

vincent_vega

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

2 Comments

Filed under software engineering

Stan in IPython: reproducing 8 schools

Continuing my experiment using Stan in IPython, here is a notebook to do a bit of the eight schools example from the RStan Getting Started Guide.

Comments Off on Stan in IPython: reproducing 8 schools

Filed under software engineering

Stan in IPython: getting starting

There has been a low murmur about new MCMC package bouncing through my email inbox for a while now. Stan, it is. The project has reached the point where the developers are soliciting Python integration volunteers, so I decided it is time to check it out.

Good news, it installed and ran the example without frustration! I don’t take that for granted with research software.

IPython Notebook here.

Comments Off on Stan in IPython: getting starting

Filed under software engineering

Better typography for IPython notebooks, now

I came across a long blog about how to make ipython notebooks more aesthetically pleasing recently, and I think there is a lot to be learned there.

The good news is that you can try this out on a notebook-by-notebook basis with a little trick. Just drop this into a cell in any IPython notebook:

import IPython.core.display

IPython.core.display.HTML("""

div.input {
width: 105ex; /* about 80 chars + buffer */
}

div.text_cell {
width: 105ex /* instead of 100%, */
}

div.text_cell_render {
/*font-family: "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;*/
font-family: "Charis SIL", serif; /* Make non-code text serif. */
line-height: 145%; /* added for some line spacing of text. */
width: 105ex; /* instead of 'inherit' for shorter lines */
}

/* Set the size of the headers */
div.text_cell_render h1 {
font-size: 18pt;
}

div.text_cell_render h2 {
font-size: 14pt;
}

.CodeMirror {
 font-family: Consolas, monospace;
 }


""")

3 Comments

Filed under Uncategorized

Coolest Demo at SciPy 2011

Speaking of SciPy 2011 (as I was in my last post), the coolest, most draw-dropping-est demo I saw there was hands-down for the new ipython. The most cutting edge stuff is available on the web. I want it.

1 Comment

Filed under software engineering, Uncategorized