Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Hands-On Data Visualization with Bokeh

You're reading from   Hands-On Data Visualization with Bokeh Interactive web plotting for Python using Bokeh

Arrow left icon
Product type Paperback
Published in Jun 2018
Publisher Packt
ISBN-13 9781789135404
Length 174 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Kevin Jolly Kevin Jolly
Author Profile Icon Kevin Jolly
Kevin Jolly
Arrow right icon
View More author details
Toc

Table of Contents (10) Chapters Close

Preface 1. Bokeh Installation and Key Concepts FREE CHAPTER 2. Plotting using Glyphs 3. Plotting with different Data Structures 4. Using Layouts for Effective Presentation 5. Using Annotations, Widgets, and Visual Attributes for Visual Enhancement 6. Building and Hosting Applications Using the Bokeh Server 7. Advanced Plotting with Networks, Geo Data, WebGL, and Exporting Plots 8. The Bokeh Workflow – A Case Study 9. Other Books You May Enjoy

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_states
from bokeh.plotting import figure, show, output_file
from 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 copy the data into Bokeh so that we can modify the data and delete states that are not significant (if required). Here, we will be deleting...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime