Book Image

Hands-On Data Visualization with Bokeh

By : Kevin Jolly
Book Image

Hands-On Data Visualization with Bokeh

By: Kevin Jolly

Overview of this book

Adding a layer of interactivity to your plots and converting these plots into applications hold immense value in the field of data science. The standard approach to adding interactivity would be to use paid software such as Tableau, but the Bokeh package in Python offers users a way to create both interactive and visually aesthetic plots for free. This book gets you up to speed with Bokeh - a popular Python library for interactive data visualization. The book starts out by helping you understand how Bokeh works internally and how you can set up and install the package in your local machine. You then use a real world data set which uses stock data from Kaggle to create interactive and visually stunning plots. You will also learn how to leverage Bokeh using some advanced concepts such as plotting with spatial and geo data. Finally you will use all the concepts that you have learned in the previous chapters to create your very own Bokeh application from scratch. By the end of the book you will be able to create your very own Bokeh application. You will have gone through a step by step process that starts with understanding what Bokeh actually is and ends with building your very own Bokeh application filled with interactive and visually aesthetic plots.
Table of Contents (10 chapters)

Creating a robust grid layout

A grid layout combines the row, column, and nested layouts, and allows you to create plots horizontally, vertically, or both horizontally and vertically. Using the grid layout is much more robust because of the versatility of combinations that the layout offers in terms of stacking multiple plots together in a single screen.

In order to construct a grid layout, we will use the same three plots that we have been working on in the previous sections.

We can create a nested grid layout using the code shown here:

#Import required packages

from bokeh.io import output_file, show
from bokeh.layouts import gridplot

#Create the grid layout

grid_layout = gridplot([plot1, plot2], [plot3, None])

#Output the plot

output_file('grid.html')

show(grid_layout)

This results in a grid layout as illustrated here:

Creating a nested layout using the grid layout

In...