Bokeh File Datacamp
Bokeh File Datacamp
Introduction to
Layouts
Interactive Data Visualization with Bokeh
Rows of plots
In [1]: from bokeh.layouts import row
In [3]: output_file('row.html')
In [4]: show(layout)
Interactive Data Visualization with Bokeh
Columns of plots
In [1]: from bokeh.layouts import column
In [3]: output_file('column.html')
In [4]: show(layout)
Interactive Data Visualization with Bokeh
Nested Layouts
● Rows and column can be nested for more
sophisticated layouts
In [3]: output_file('nested.html')
In [4]: show(layout)
INTERACTIVE DATA VISUALIZATION WITH BOKEH
Let’s practice!
INTERACTIVE DATA VISUALIZATION WITH BOKEH
Advanced
Layouts
Interactive Data Visualization with Bokeh
Gridplots
In [1]: from bokeh.layouts import gridplot
In [3]: output_file('nested.html')
In [4]: show(layout)
Tabbed Layouts
In [1]: from bokeh.models.widgets import Tabs, Panel
In [7]: output_file('tabbed.html')
In [8]: show(layout)
Interactive Data Visualization with Bokeh
Tabbed Layouts
INTERACTIVE DATA VISUALIZATION WITH BOKEH
Let’s practice!
INTERACTIVE DATA VISUALIZATION WITH BOKEH
Linking Plots
Together
Interactive Data Visualization with Bokeh
Linking axes
In [1]: p3.x_range = p2.x_range = p1.x_range
Linking selections
In [1]: p1 = figure(title='petal length vs. sepal length')
Linking selections
INTERACTIVE DATA VISUALIZATION WITH BOKEH
Let’s practice!
INTERACTIVE DATA VISUALIZATION WITH BOKEH
Annotations
and Guides
Interactive Data Visualization with Bokeh
Legends
In [1]: plot.circle('petal_length', 'sepal_length',
...: size=10, source=source,
...: color={'field': 'species',
...: 'transform': mapper},
...: legend='species')
Hover Tooltips
In [1]: from bokeh.models import HoverTool
Let’s practice!