The result (static image) is:
I firstly thought that Bokeh uses matplotlib. We generate figure using matplotlib then convert the figure to the Bokeh compatible. However, it seems Bokeh works stand alone without matplotlib (is it true?) Anyway, let's check whether Bokeh works in my environment or not.
See also:
This page shows how to plot data in interactive figure using python, matplotlib.pyplot and mpld3. A interactive legend is added to the figure.
Tips for drawing efficient figures using python matplotlib pyplot. You can brush up them by adding some additional options and settings.
This code is based on the following web pages:
- Installation - Bokeh 1.0.1 documentation - URL: http://bokeh.pydata.org/en/latest/docs/installation.html
- Working in the Notebook - Bokeh 1.0.1 documentation - URL: http://bokeh.pydata.org/en/latest/docs/user_guide/notebook.html
In [1]:
import platform
print('python: '+platform.python_version())
Load Bokeh library
In [2]:
from bokeh.plotting import figure, output_file, show
from bokeh.io import output_notebook
output_notebook()
In [3]:
p = figure()
p.line([1, 2, 3, 4, 5], [6, 7, 2, 4, 5], line_width=2)
show(p)