View on GitHub

melissagymrek.com

Resources for IPython presentations

Comments

A list of useful IPython tools I've made/compiled from other people that I use in my IPython presentations.

Formatted tables

Widgets for animated slides

For these I have forked the ipywidgets github repository and added my own useful widgets for animation.

Templates

For many presentations, you may not want the code from input cells to be visible. I use the template posted on @damian_vila's blog. This allows you to hide the input slides, but clicking on the output cell toggles the input cell. This makes it really fun in presentations, if someone asks how you did something, simply click on the figure/table to reveal the code! To use a template to compile your slides: Read more about IPython configuration

Other useful functions

Center a figure

import matplotlib.pyplot
import rpy2.robjects
import IPython.core.display
from IPython import get_ipython

def center_figure(fig):
    ip = get_ipython()
    png_rep = ip.display_formatter.formatters["image/png"](fig)
    matplotlib.pyplot.close(fig)
    return IPython.core.display.HTML('<center><img src="data:Image/png;base64,{0}"></center>'.format(png_rep.encode('base64')))

Example

Here's an example slideshow showing these features, and the ipynb file used to generate it (make sure the "Cell Toolbar" is set to "Slideshow").
comments powered by Disqus