.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/04_flows/plot_03_chord.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code or to run this example in your browser via Binder. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_04_flows_plot_03_chord.py: 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. .. GENERATED FROM PYTHON SOURCE LINES 9-16 .. code-block:: Python 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) .. image-sg:: /auto_examples/04_flows/images/sphx_glr_plot_03_chord_001.png :alt: chord diagram of transitions (colored by source) :srcset: /auto_examples/04_flows/images/sphx_glr_plot_03_chord_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 17-19 One chord per persona --------------------- .. GENERATED FROM PYTHON SOURCE LINES 19-23 .. code-block:: Python 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() .. image-sg:: /auto_examples/04_flows/images/sphx_glr_plot_03_chord_002.png :alt: commuter, remote worker, early bird :srcset: /auto_examples/04_flows/images/sphx_glr_plot_03_chord_002.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.202 seconds) .. _sphx_glr_download_auto_examples_04_flows_plot_03_chord.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: binder-badge .. image:: images/binder_badge_logo.svg :target: https://mybinder.org/v2/gh/ComplexSystemsIntelligence/spmviz/main?urlpath=lab/tree/notebooks/auto_examples/04_flows/plot_03_chord.ipynb :alt: Launch binder :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_03_chord.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_03_chord.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_03_chord.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_