Us Unemployment#
Download this notebook from GitHub (right-click to download).
URL: https://docs.bokeh.org/en/latest/docs/examples/topics/categorical/heatmap_unemployment.html
Most examples work across multiple plotting backends, this example is also available for:
import pandas as pd
import holoviews as hv
from holoviews import opts
hv.extension('bokeh')
Defining data#
from bokeh.sampledata.unemployment1948 import data
data = pd.melt(data.drop('Annual', axis=1), id_vars='Year', var_name='Month', value_name='Unemployment')
heatmap = hv.HeatMap(data, label="US Unemployment (1948 - 2013)")
Plot#
colors = ["#75968f", "#a5bab7", "#c9d9d3", "#e2e2e2", "#dfccce", "#ddb7b1", "#cc7878", "#933b41", "#550b1d"]
heatmap.opts(
opts.HeatMap(width=900, height=400, xrotation=45, xaxis='top', labelled=[],
tools=['hover'], cmap=colors))
This web page was generated from a Jupyter notebook and not all interactivity will work on this website. Right click to download and run locally for full Python-backed interactivity.
Download this notebook from GitHub (right-click to download).