.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "generated/gallery/visualisation/plotting_ripple_image.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_ripple_image.py: ======================== Plotting a RippleImage ======================== How to plot a ripple image using inbuilt plotting methods. .. GENERATED FROM PYTHON SOURCE LINES 8-18 .. code-block:: Python from matplotlib import pyplot as plt from ripplemapper.analyse import add_boundary_contours from ripplemapper.classes import RippleImage from ripplemapper.data.example import example_data ripple_img = RippleImage(example_data[2]) add_boundary_contours(ripple_img, sigma=2) .. GENERATED FROM PYTHON SOURCE LINES 19-20 We can plot the image by calling `RippleImage.plot`. .. GENERATED FROM PYTHON SOURCE LINES 21-25 .. code-block:: Python ripple_img.plot(include_contours=False) plt.show() .. image-sg:: /generated/gallery/visualisation/images/sphx_glr_plotting_ripple_image_001.png :alt: RippleImage: 1_00375_sample.tif :srcset: /generated/gallery/visualisation/images/sphx_glr_plotting_ripple_image_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 26-27 If there are contours on the image, we can plot the contours (enabled by default). .. GENERATED FROM PYTHON SOURCE LINES 27-31 .. code-block:: Python ripple_img.plot(include_contours=True) plt.show() .. image-sg:: /generated/gallery/visualisation/images/sphx_glr_plotting_ripple_image_002.png :alt: RippleImage: 1_00375_sample.tif :srcset: /generated/gallery/visualisation/images/sphx_glr_plotting_ripple_image_002.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 32-33 We can pass any `matplotlib.pyplot.imshow` arguments to the `plot` method. .. GENERATED FROM PYTHON SOURCE LINES 33-36 .. code-block:: Python ripple_img.plot(include_contours=True, cmap='viridis') plt.show() .. image-sg:: /generated/gallery/visualisation/images/sphx_glr_plotting_ripple_image_003.png :alt: RippleImage: 1_00375_sample.tif :srcset: /generated/gallery/visualisation/images/sphx_glr_plotting_ripple_image_003.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.164 seconds) .. _sphx_glr_download_generated_gallery_visualisation_plotting_ripple_image.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plotting_ripple_image.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plotting_ripple_image.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plotting_ripple_image.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_