Chord diagram of everyday transitions#

A chord diagram arranges the activities on a circle; a ribbon from one arc to another carries the transitions between them (colored by the source). It shows the loops of a day at a glance: work ↔ lunch, dinner → tv → sleep.

import matplotlib.pyplot as plt

import spmviz as sv
from spmviz.viz import plot_chord
db = sv.datasets.make_daily_routines(300, random_state=0)
plot_chord(db, top=12)
chord diagram of transitions (colored by source)
<Axes: title={'left': 'chord diagram of transitions (colored by source)'}>

One chord per persona#

fig, axes = plt.subplots(1, 3, figsize=(16, 5.5))
for ax, (who, sub) in zip(axes, db.split("persona").items()):
    plot_chord(sub, ax=ax, top=10, title=who)
plt.show()
commuter, remote worker, early bird

Total running time of the script: (0 minutes 0.243 seconds)

Gallery generated by Sphinx-Gallery