.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/2D/06-plot2d_rgt.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_06-plot2d_rgt.py: Showing 2d's slice, rgt ================================ You can set the cmap reasonably well to mask some areas .. image:: ../../_static/cigvis/2D/06.png :alt: image :align: center .. GENERATED FROM PYTHON SOURCE LINES 16-89 .. code-block:: default # sphinx_gallery_thumbnail_path = '_static/cigvis/2D/06.png' import cigvis import numpy as np import matplotlib.pyplot as plt from cigvis import colormap 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) sx2 = sx[30, :, :] lx2 = lx[30, :, :] fg1 = {} fg1['img'] = cigvis.fg_image_args(lx2, alpha=0.5) fg2 = {} fg2_cmap = colormap.set_alpha_except_max('jet', 0.5, False) fg2['img'] = cigvis.fg_image_args(lx2, fg2_cmap, clim=[lx2.min(), lx2.max() * 0.8]) fg3 = {} fg3_cmap = colormap.set_alpha_except_top('jet', 0.5, clim=[lx2.min(), lx2.max()], segm=lx2.max() * 0.8, forvispy=False) fg3['img'] = cigvis.fg_image_args(lx2, fg3_cmap) fg4 = {} fg4_cmap = colormap.set_alpha_except_ranges('jet', 0.5, [lx2.min(), lx2.max()], r=[[120, 130], [140, 150]], forvispy=False) fg4['img'] = cigvis.fg_image_args(lx2, fg4_cmap) fig, axs = plt.subplots(2, 2, figsize=(8.5, 7)) cigvis.plot2d(sx2, fg1, ax=axs[0, 0], cbar='rgt', xlabel='xline', ylabel='time', title='overlid') cigvis.plot2d(sx2, fg2, ax=axs[0, 1], cbar='rgt', xlabel='xline', ylabel='time', title='except top 1') cigvis.plot2d(sx2, fg3, ax=axs[1, 0], cbar='rgt', xlabel='xline', ylabel='time', title='except top 2') cigvis.plot2d(sx2, fg4, ax=axs[1, 1], cbar='rgt', xlabel='xline', ylabel='time', title='except range') 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_06-plot2d_rgt.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: 06-plot2d_rgt.py <06-plot2d_rgt.py>` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: 06-plot2d_rgt.ipynb <06-plot2d_rgt.ipynb>` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_