.. only:: html .. 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 :alt: subplot toolbar :class: sphx-glr-multi-img * .. image:: /gallery/subplots_axes_and_figures/images/sphx_glr_subplot_toolbar_002.png :alt: Click on slider to adjust subplot param :class: sphx-glr-multi-img .. code-block:: default import matplotlib.pyplot as plt import numpy as np # Fixing random state for reproducibility np.random.seed(19680801) 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() .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 1.018 seconds) .. _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 sphx-glr-download-python :download:`Download Python source code: subplot_toolbar.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :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 `_