The tutorial is broken into several sections, which are each presented in their own notebook:
Bokeh is a Data Visualization library for
And most importantly:
# Standard imports from bokeh.io import output_notebook, show output_notebook()
# Plot a complex chart in a single line from bokeh.charts import Histogram from bokeh.sampledata.iris import flowers as data hist = Histogram(data, values="petal_length", color="species", legend="top_right", bins=12) show(hist)
# Build and serve beautiful web-ready interactive visualizations import utils p = utils.get_gapminder_plot() show(p)
# Create and deploy interactive data applications from IPython.display import IFrame IFrame('http://demo.bokehplots.com/apps/sliders', width=900, height=500)
from IPython.core.display import Markdown Markdown(open("README.md").read())
First get local copies of the tutorial notebooks:
$ git clone https://github.com/bokeh/bokeh-notebooks.git
Or download from: https://github.com/bokeh/bokeh-notebooks/archive/master.zip
This tutorial has been tested on:
Other combinations may work also. Packages are available via PyPI and anaconda.org.
Anaconda should come with all the dependencies included, but you may need to update your versions.
Use the command line to create an environment and install the packages:
$ conda env create $ source activate bokeh-notebooks
Run this from the tutorial directory where environment.yml lives.
Bokeh has a sample data download that gives us some data to build demo visualizations. To get it run:
$ bokeh sampledata
Optional tutorials 11 and 12 require the datashader and holoviews packages, respectively, which can be installed with:
$ conda install -c bokeh datashader $ conda install -c holoviews/label/dev holoviews
From this folder run jupyter notebook, and open the
$ jupyter notebook
Setup-test, run the next cell. Hopefully you should see output that looks something like this:
IPython - 5.1.0 Pandas - 0.18.1 Bokeh - 0.12.2
If this isn't working for you, see the
README.md in this directory.
from IPython import __version__ as ipython_version from pandas import __version__ as pandas_version from bokeh import __version__ as bokeh_version print("IPython - %s" % ipython_version) print("Pandas - %s" % pandas_version) print("Bokeh - %s" % bokeh_version)
IPython - 5.1.0 Pandas - 0.18.1 Bokeh - 0.12.2rc3