Visualizing geographic data with Bokeh

In this section, we are going to create a Bokeh visualization for the states in the USA that have the lowest crime rates. In order to do this, we will render a map of the USA and pinpoint the states that have the lowest crime rates.

The first step is to import the required packages:

from bokeh.sampledata import us_statesfrom bokeh.plotting import figure, show, output_filefrom bokeh.models import HoverTool

us_states is a dictionary containing all the information that we need to construct a map of the USA in Bokeh. Additionally, if you wanted to create a map of any other country in Bokeh, you can find the necessary geo data on the web and import the file into your Jupyter Notebook. 

The next step is to ...

Get Hands-On Data Visualization with Bokeh now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.