.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/03_trees/plot_05_lifeflow_icicle.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_03_trees_plot_05_lifeflow_icicle.py: Time-aware icicles (LifeFlow) ============================= LifeFlow (Wongsuphasawat et al., 2011) aggregates sequences into a tree and places each node at the *mean time* elapsed since the start, so the horizontal gaps show how long the steps take. Here the days of the three personas: early birds reach their first coffee quickly, remote workers start work right after it. .. GENERATED FROM PYTHON SOURCE LINES 10-18 .. code-block:: Python import matplotlib.pyplot as plt import spmviz as sv from spmviz.viz import plot_icicle db = sv.datasets.make_daily_routines(300, random_state=0) plot_icicle(db, max_depth=5, min_count=15, time_aware=True, title="mean time since waking up (hours)") .. image-sg:: /auto_examples/03_trees/images/sphx_glr_plot_05_lifeflow_icicle_001.png :alt: mean time since waking up (hours) :srcset: /auto_examples/03_trees/images/sphx_glr_plot_05_lifeflow_icicle_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 19-21 One persona at a time --------------------- .. GENERATED FROM PYTHON SOURCE LINES 21-25 .. code-block:: Python fig, axes = plt.subplots(3, 1, figsize=(9, 10)) for ax, (who, sub) in zip(axes, db.split("persona").items()): plot_icicle(sub, ax=ax, max_depth=5, min_count=5, time_aware=True, title=who) plt.show() .. image-sg:: /auto_examples/03_trees/images/sphx_glr_plot_05_lifeflow_icicle_002.png :alt: commuter, remote worker, early bird :srcset: /auto_examples/03_trees/images/sphx_glr_plot_05_lifeflow_icicle_002.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.283 seconds) .. _sphx_glr_download_auto_examples_03_trees_plot_05_lifeflow_icicle.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/03_trees/plot_05_lifeflow_icicle.ipynb :alt: Launch binder :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_05_lifeflow_icicle.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_05_lifeflow_icicle.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_05_lifeflow_icicle.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_