.. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_plot_subplots.py: Handle subplots with brokenaxes =============================== If you want to use subplots together with brokenaxes, you have to use GridSpec. .. image:: /auto_examples/images/sphx_glr_plot_subplots_001.png :class: sphx-glr-single-img .. code-block:: default from brokenaxes import brokenaxes from matplotlib.gridspec import GridSpec import numpy as np sps1, sps2 = GridSpec(2,1) bax = brokenaxes(xlims=((.1, .3),(.7, .8)), subplot_spec=sps1) x = np.linspace(0, 1, 100) bax.plot(x, np.sin(x*30), ls=':', color='m') x = np.random.poisson(3, 1000) bax = brokenaxes(xlims=((0, 2.5), (3, 6)), subplot_spec=sps2) bax.hist(x, histtype='bar') .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 8.709 seconds) .. _sphx_glr_download_auto_examples_plot_subplots.py: .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: sphx-glr-download :download:`Download Python source code: plot_subplots.py ` .. container:: sphx-glr-download :download:`Download Jupyter notebook: plot_subplots.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_