.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/2D/05-plot2d_subplots.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_2D_05-plot2d_subplots.py: Displaying multiple images using subplots ============================================ .. image:: ../../_static/cigvis/2D/05.png :alt: image :align: center .. GENERATED FROM PYTHON SOURCE LINES 14-41 .. code-block:: default # sphinx_gallery_thumbnail_path = '_static/cigvis/2D/05.png' import cigvis import numpy as np import matplotlib.pyplot as plt sx = np.fromfile('../../data/rgt/sx.dat', np.float32).reshape(128, 128, 128) lx = np.fromfile('../../data/rgt/ux.dat', np.float32).reshape(128, 128, 128) fig, axes = plt.subplots(nrows=2, ncols=2, figsize=(6, 6)) fg = dict(img=cigvis.fg_image_args(lx[30, :, :], alpha=0.5)) cigvis.plot2d(sx[30, :, :], fg, title='inline=30', ax=axes[0, 0]) fg = dict(img=cigvis.fg_image_args(lx[60, :, :], alpha=0.5)) cigvis.plot2d(sx[60, :, :], fg, title='inline=60', ax=axes[0, 1]) fg = dict(img=cigvis.fg_image_args(lx[90, :, :], alpha=0.5)) cigvis.plot2d(sx[90, :, :], fg, title='inline=90', ax=axes[1, 0]) fg = dict(img=cigvis.fg_image_args(lx[120, :, :], alpha=0.5)) cigvis.plot2d(sx[120, :, :], fg, title='inline=120', ax=axes[1, 1]) plt.tight_layout() plt.savefig('example.png', bbox_inches='tight', pad_inches=0.01, dpi=200) plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.000 seconds) .. _sphx_glr_download_gallery_2D_05-plot2d_subplots.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: 05-plot2d_subplots.py <05-plot2d_subplots.py>` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: 05-plot2d_subplots.ipynb <05-plot2d_subplots.ipynb>` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_