.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/plot_08_viewing_2_axes.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_examples_plot_08_viewing_2_axes.py: Viewing Multiple Axes From A Single View ======================================== Views can view multiple axes at the same time, by simply calling :meth:`matplotview.view` multiple times. .. GENERATED FROM PYTHON SOURCE LINES 7-28 .. image-sg:: /examples/images/sphx_glr_plot_08_viewing_2_axes_001.png :alt: plot 08 viewing 2 axes :srcset: /examples/images/sphx_glr_plot_08_viewing_2_axes_001.png :class: sphx-glr-single-img .. code-block:: default :lineno-start: 7 import matplotlib.pyplot as plt from matplotview import view fig, (ax1, ax2, ax3) = plt.subplots(1, 3) # We'll plot 2 circles in axes 1 and 3. ax1.add_patch(plt.Circle((1, 1), 1.5, ec="black", fc=(0, 0, 1, 0.5))) ax3.add_patch(plt.Circle((3, 1), 1.5, ec="black", fc=(1, 0, 0, 0.5))) for ax in (ax1, ax3): ax.set_aspect(1) ax.relim() ax.autoscale_view() # Axes 2 is a view of 1 and 3 at the same time (view returns the axes it turns into a view...) view(view(ax2, ax1), ax3) # Change data limits, so we can see the entire 'venn diagram' ax2.set_aspect(1) ax2.set_xlim(-0.5, 4.5) ax2.set_ylim(-0.5, 2.5) fig.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.188 seconds) .. _sphx_glr_download_examples_plot_08_viewing_2_axes.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_08_viewing_2_axes.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_08_viewing_2_axes.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_