.. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_gallery_subplots_axes_and_figures_subplot_toolbar.py: =============== Subplot Toolbar =============== Matplotlib has a toolbar available for adjusting subplot spacing. .. rst-class:: sphx-glr-horizontal * .. image:: /gallery/subplots_axes_and_figures/images/sphx_glr_subplot_toolbar_001.png :class: sphx-glr-multi-img * .. image:: /gallery/subplots_axes_and_figures/images/sphx_glr_subplot_toolbar_002.png :class: sphx-glr-multi-img .. code-block:: default import matplotlib.pyplot as plt import numpy as np fig, axs = plt.subplots(2, 2) axs[0, 0].imshow(np.random.random((100, 100))) axs[0, 1].imshow(np.random.random((100, 100))) axs[1, 0].imshow(np.random.random((100, 100))) axs[1, 1].imshow(np.random.random((100, 100))) plt.subplot_tool() plt.show() .. _sphx_glr_download_gallery_subplots_axes_and_figures_subplot_toolbar.py: .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: sphx-glr-download :download:`Download Python source code: subplot_toolbar.py ` .. container:: sphx-glr-download :download:`Download Jupyter notebook: subplot_toolbar.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature Keywords: matplotlib code example, codex, python plot, pyplot `Gallery generated by Sphinx-Gallery `_