.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery_examples/maps/sync_maps.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_gallery_examples_maps_sync_maps.py: .. _example_sync_maps: Sync map zoom ############# Example showing how to synchromnize the zoom level (axes limits) of several FITS map files using :func:`~madcubapy.visualization.sync_zoom`. .. GENERATED FROM PYTHON SOURCE LINES 11-41 .. image-sg:: /gallery_examples/maps/images/sphx_glr_sync_maps_001.png :alt: SO$_2$ low-res, SO$_2$ high-res :srcset: /gallery_examples/maps/images/sphx_glr_sync_maps_001.png :class: sphx-glr-single-img .. code-block:: Python from madcubapy.io import MadcubaMap from madcubapy.visualization import add_wcs_axes from madcubapy.visualization import sync_zoom import matplotlib.pyplot as plt # Read fits file map_high_res = MadcubaMap.read("../data/IRAS16293_SO2a_tm1.fits") map_low_res = MadcubaMap.read("../data/IRAS16293_SO2a_tm2.fits") # Create empty figure fig = plt.figure(figsize=(10,5)) # Add as many WCS axes objects as desired. # We can pass kwargs for matplotlib.pyploy.imshow() ax1, img1 = add_wcs_axes(fig, 1, 2, 1, fitsmap=map_low_res, vmax=1500) ax1.set_title(r"SO$_2$ low-res") ax2, img2 = add_wcs_axes(fig, 1, 2, 2, fitsmap=map_high_res, vmax=400) ax2.set_title(r"SO$_2$ high-res") # Activate synchronization between axes sync_zoom(ax1, ax2) # Any change in the limits of any of the synchronized axes after `sync_zoom` # has been called will change the other axes as well. ax2.set_xlim(140, 330) ax2.set_ylim(130, 350) plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.173 seconds) .. _sphx_glr_download_gallery_examples_maps_sync_maps.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: sync_maps.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: sync_maps.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: sync_maps.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_