.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/06_sequences/plot_02_chronogram_frequency.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_06_sequences_plot_02_chronogram_frequency.py: Chronograms and sequence frequency plots ======================================== Two summaries from TraMineR (Gabadinho et al., 2011): the *state distribution plot* stacks the events found at each position (with the cross-sectional entropy as a line), the *sequence frequency plot* shows the most frequent complete sequences with bar heights proportional to their frequency. .. GENERATED FROM PYTHON SOURCE LINES 10-21 .. rst-class:: sphx-glr-horizontal * .. image-sg:: /auto_examples/06_sequences/images/sphx_glr_plot_02_chronogram_frequency_001.png :alt: state distribution plot (chronogram) :srcset: /auto_examples/06_sequences/images/sphx_glr_plot_02_chronogram_frequency_001.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/06_sequences/images/sphx_glr_plot_02_chronogram_frequency_002.png :alt: the 10 most frequent sequences (59.9% of all) :srcset: /auto_examples/06_sequences/images/sphx_glr_plot_02_chronogram_frequency_002.png :class: sphx-glr-multi-img .. code-block:: Python import matplotlib.pyplot as plt import spmviz as sv from spmviz.viz import plot_sequence_frequency, plot_state_distribution days = sv.datasets.make_daily_routines(300, random_state=0) shop = sv.datasets.make_customer_journeys(1000, random_state=0) plot_state_distribution(days, max_steps=15) plot_sequence_frequency(shop, top=10) plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.241 seconds) .. _sphx_glr_download_auto_examples_06_sequences_plot_02_chronogram_frequency.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/06_sequences/plot_02_chronogram_frequency.ipynb :alt: Launch binder :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_02_chronogram_frequency.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_02_chronogram_frequency.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_02_chronogram_frequency.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_