.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "generated/gallery/visualisation/plotting_a_timeseries.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. .. rst-class:: sphx-glr-example-title .. _sphx_glr_generated_gallery_visualisation_plotting_a_timeseries.py: =================================== Plotting a timeseries of a contour =================================== A RippleImageSeries is simply a container class for a list of RippleImages. This example demonstrates how to plot a RippleImageSeries using inbuilt plotting methods. .. GENERATED FROM PYTHON SOURCE LINES 10-19 .. code-block:: Python from matplotlib import pyplot as plt from ripplemapper.analyse import (add_a_star_contours, add_boundary_contours, add_chan_vese_contours) from ripplemapper.classes import RippleImageSeries from ripplemapper.data.example import example_dir from ripplemapper.io import load_dir_to_obj .. GENERATED FROM PYTHON SOURCE LINES 20-24 We can create a list of RippleImages from a list of image files. In this example we use the load_dir_to_obj method to load all images in a directory into RippleImage objects. Passing this list to the RippleImageSeries constructor will create a RippleImageSeries object. .. GENERATED FROM PYTHON SOURCE LINES 25-32 .. code-block:: Python ripple_images = load_dir_to_obj(example_dir) series = RippleImageSeries(ripple_images) add_boundary_contours(series, sigma=2) add_a_star_contours(series) add_chan_vese_contours(series) .. GENERATED FROM PYTHON SOURCE LINES 33-36 We can plot a timeseries of this object, showing how the same contour evolves over time. We can refer to the contour via index: .. GENERATED FROM PYTHON SOURCE LINES 37-41 .. code-block:: Python series.timeseries(1) plt.show() .. image-sg:: /generated/gallery/visualisation/images/sphx_glr_plotting_a_timeseries_001.png :alt: plotting a timeseries :srcset: /generated/gallery/visualisation/images/sphx_glr_plotting_a_timeseries_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 42-43 or via the method name: .. GENERATED FROM PYTHON SOURCE LINES 44-47 .. code-block:: Python series.timeseries('A* traversal') plt.show() .. image-sg:: /generated/gallery/visualisation/images/sphx_glr_plotting_a_timeseries_002.png :alt: plotting a timeseries :srcset: /generated/gallery/visualisation/images/sphx_glr_plotting_a_timeseries_002.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 5.322 seconds) .. _sphx_glr_download_generated_gallery_visualisation_plotting_a_timeseries.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plotting_a_timeseries.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plotting_a_timeseries.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plotting_a_timeseries.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_