.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/layouts/01_shared_axes_abc.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_layouts_01_shared_axes_abc.py: Shared axes and ABC labels ========================= A multi-panel layout with shared limits, shared labels, and automatic panel labels. Why UltraPlot here? ------------------- UltraPlot shares limits and labels across a grid with a single ``share``/``span`` configuration, and adds panel letters automatically. This keeps complex layouts consistent without the manual axis management required in base Matplotlib. Key functions: :py:func:`ultraplot.ui.subplots`, :py:meth:`ultraplot.gridspec.SubplotGrid.format`. See also -------- * :doc:`Subplots and layouts ` .. GENERATED FROM PYTHON SOURCE LINES 19-46 .. image-sg:: /gallery/layouts/images/sphx_glr_01_shared_axes_abc_001.png :alt: Shared axes with consistent limits and panel lettering :srcset: /gallery/layouts/images/sphx_glr_01_shared_axes_abc_001.png :class: sphx-glr-single-img .. code-block:: Python import numpy as np import ultraplot as uplt rng = np.random.default_rng(12) x = np.linspace(0, 10, 300) layout = [[1, 2, 3], [1, 2, 4], [1, 2, 5]] fig, axs = uplt.subplots( layout, ) for i, ax in enumerate(axs): noise = 0.15 * rng.standard_normal(x.size) y = np.sin(x + i * 0.4) + 0.2 * np.cos(2 * x) + 0.1 * i + noise ax.plot(x, y, lw=2) ax.scatter(x[::30], y[::30], s=18, alpha=0.65) axs.format( abc="[A.]", xlabel="Time (s)", ylabel="Signal", suptitle="Shared axes with consistent limits and panel lettering", grid=False, ) fig.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 1.474 seconds) .. _sphx_glr_download_gallery_layouts_01_shared_axes_abc.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: 01_shared_axes_abc.ipynb <01_shared_axes_abc.ipynb>` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: 01_shared_axes_abc.py <01_shared_axes_abc.py>` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: 01_shared_axes_abc.zip <01_shared_axes_abc.zip>` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_