.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/06_sequences/plot_03_dotted_chart.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_03_dotted_chart.py: Dotted chart of alarm floods ============================ The dotted chart of process mining (Song & van der Aalst, 2007) plots every event at its time (here relative to the start of the trace) and its trace. A highlighted pattern is drawn as a line through its occurrence, revealing its typical duration and position in the flood. .. GENERATED FROM PYTHON SOURCE LINES 10-18 .. code-block:: Python import matplotlib.pyplot as plt import spmviz as sv from spmviz.viz import plot_dotted_chart, plot_gap_distribution db = sv.datasets.make_alarm_cascades(400, random_state=0) plot_dotted_chart(db, max_sequences=120, highlight="P-LOWFLOW P-TRIP OP-PUMPSTART") .. image-sg:: /auto_examples/06_sequences/images/sphx_glr_plot_03_dotted_chart_001.png :alt: dotted chart :srcset: /auto_examples/06_sequences/images/sphx_glr_plot_03_dotted_chart_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 19-21 How long do the patterns take? ------------------------------ .. GENERATED FROM PYTHON SOURCE LINES 21-24 .. code-block:: Python ps = sv.mine(db, 0.08, max_length=4) plot_gap_distribution(ps, top=10) plt.show() .. image-sg:: /auto_examples/06_sequences/images/sphx_glr_plot_03_dotted_chart_002.png :alt: time span of the occurrences of the top patterns :srcset: /auto_examples/06_sequences/images/sphx_glr_plot_03_dotted_chart_002.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.268 seconds) .. _sphx_glr_download_auto_examples_06_sequences_plot_03_dotted_chart.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_03_dotted_chart.ipynb :alt: Launch binder :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_03_dotted_chart.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_03_dotted_chart.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_03_dotted_chart.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_