The Living Thing / Notebooks : Jupyter, a scientific notebook

jupyter notebook in action

The python-derived entrant in the scientific workbook field.

Works with python/julia/various. jupyter allows easy(ish) online-publication-friendly worksheets, which are both interactive and easy to export for static online use. Handy.

Pro tips


Set up inline plots:

%matplotlib inline

inline svg:

%config InlineBackend.figure_format = 'svg'

Graph sizes are controlled by matplotlib. Here’s how to make big graphs:

import matplotlib as mpl
mpl.rcParams['figure.figsize'] = (10.0, 8.0)

Interesting-looking other extensions:

Interactive visualisations/simulations etc

You’re looking for ipywidgets.

See also the announcement: Jupyter supports interactive JS widgets, which is by far the easiest python UI system I have seen for all that it is basic.

Pro tip: If you want a list of widgets

from ipywidgets import widget

Javascript from python with jupyter

As seen in art python.

Here’s how you invoke javascript from jupyter. Here is the jupyter JS source And here is the full jupyter browser JS manual, and the Jupyter JS extension guide.

Exporting notebooks

Citations in jupyter

tl;dr I did this for my blog using simple markdown citation export from zotero, which is not great for inline citations but fine for bibliographies, and very easy and robust.

Offline mathjax in jupyter

Hmmmm. Try:

python -m IPython.external.mathjax /path/to/source/

Hosting live jupyter notebooks

The full version gives online notebooks, even multi-user notebook servers.