US Mortality Race and Manner of Death
In this notebook we're going to use PlotAPI Chord to visualise the co-occurrences between race and manner of death in the US throughout 2015. We"ll use Python, but PlotAPI can be used from any programming language.
Preamble
import json
from plotapi import Chord
Introduction
In this notebook we're going to use PlotAPI Chord to visualise the co-occurrences between race and manner of death in the US throughout 2015. We"ll use Python, but PlotAPI can be used from any programming language.
Dataset
Let"s get loading the data.
with open("us-mortality.json", "r") as f:
data = json.load(f)
Visualisation
Let's use PlotAPI Chord for this visualisation.
plot = Chord(
data["matrix"],
data["names"],
colors=data["colors"],
wrap_labels=False,
bipartite=True,
noun="percent",
bipartite_idx=data["bipartite_idx"],
bipartite_size=.2,
width=700
)
Display inline
plot
Upload to cloud
With our plot created, let's upload it to PlotAPI cloud and get a shareable link.
# plot.upload(
# name="US Mortality Race and Manner of Death",
# description='''In this notebook we're going to use PlotAPI Chord to visualise the co-occurrences between race and manner of death in the US throughout 2015. We"ll use Python, but PlotAPI can be used from any programming language.''',
# maximized=True,
# public=True,
# )