.. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_image_plot_mtf.py: ======================= Markov Transition Field ======================= A Markov Transition Field is an image obtained from a time series, representing a field of transition probabilities for a discretized time series. Different strategies can be used to bin time series. his example illustrates the transformation on the first sample of the *GunPoint* dataset. It is implemented as :class:`pyts.image.MarkovTransitionField`. .. image:: /auto_examples/image/images/sphx_glr_plot_mtf_001.png :class: sphx-glr-single-img .. code-block:: default # Author: Johann Faouzi # License: BSD-3-Clause import matplotlib.pyplot as plt from pyts.image import MarkovTransitionField from pyts.datasets import load_gunpoint X, _, _, _ = load_gunpoint(return_X_y=True) # MTF transformation mtf = MarkovTransitionField(image_size=24) X_mtf = mtf.fit_transform(X) # Show the image for the first time series plt.figure(figsize=(5, 5)) plt.imshow(X_mtf[0], cmap='rainbow', origin='lower') plt.title('Markov Transition Field', fontsize=18) plt.colorbar(fraction=0.0457, pad=0.04) plt.tight_layout() plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 1.800 seconds) .. _sphx_glr_download_auto_examples_image_plot_mtf.py: .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: sphx-glr-download :download:`Download Python source code: plot_mtf.py ` .. container:: sphx-glr-download :download:`Download Jupyter notebook: plot_mtf.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_