<img src="images/continuum_analytics_logo.png" alt="Continuum Logo", align="right", width="30%">

Introduction to Bokeh

In this tutorial we'll learn how to use Bokeh to build interactive visualizations viewable in a browser. Generally this tutorial will have the following format

  1. charting - High level interface to go from data to plot
  2. plotting - Intermediate interface allowing control to all parts of a plot
    • Vectorized attributes
    • Toolbars
    • Linked Brushing
    • Interactivity
  3. Baseball example - Example of viewing statistics of baseball

Install

This tutorial uses many different libraries that are all available with the Anaconda Distribution. Once you have Anaconda install, please run these commands from a terminal:

$ conda install -y blaze
$ conda install -y bokeh
$ conda install -y odo

Introduction to Bokeh

Provide a first-class visualization library for web-aware applications, without requiring web-level programming.

We wrote JavaScript, so you don't have to.

Write a visualization python. Bokeh creates data descripors and a scenegraph consumed by BokehJS. This works in ipython notebook, creating static files and interacting with dynamic data sources.

Bokeh includes pre-built schemas in bokeh.charts, a low-level composition interface (similar to matplotlib), a server for large and/or dynamic datasources and widgets for providing client-side realtime interaction.

The non-JS framework also has prototypes in other languages (Scala, Julia...maybe R).

Note: There are examples notebooks in bokeh/examples/plotting/notebooks. Start an ipython notebook server there to get more examples.

Gallery -- tutorial -- Documentation -- Repo


In [1]:
import pandas as pd
import numpy as np

Output

Bokeh can output to html, a notebook, or just fragments for embedding in a web application.

To start playing, we'll use the notebook. Later we will see the other types of output.


In [2]:
from bokeh.plotting import output_notebook  
output_notebook() # Tell Bokeh to output in an ipython notebook (other options later)