imshow#

This is a wrapper around matplotlib’s imshow that works better with voxel images

import porespy as ps
import matplotlib.pyplot as plt
ps.visualization.set_mpl_style()
[17:45:42] ERROR    PARDISO solver not installed, run `pip install pypardiso`. Otherwise,          _workspace.py:56
                    simulations will be slow. Apple M chips not supported.                                         

im#

The image to show. Can be 2D or 3D:

im = ps.generators.blobs([100, 100, 100], blobiness=[1, 2, 3])
ps.visualization.imshow(im);
../../../_images/b30d200bad045f5e48465bcc8f356c4050b4c6620e032dd7949013c5986f1004.png

axis#

3D images must be sliced to present a 2D view. This argument controls which axis to slice along. The default is 2, which is the traditional z-axis, so the function will show an xy slice.

ps.visualization.imshow(im, axis=1);
../../../_images/237b8a4c4c91c9ce597451d644a04d91c4704b7a83aaf780998d690028204907.png

ind#

The location or index to slice at, with the default being the midpoint of the specified axis.

ps.visualization.imshow(im, axis=1, ind=10);
../../../_images/310b022d4f34c398108faf0008ecd2e60fc868181b12c91785114f15c8291801.png

kwargs#

All other keyword arguments are passed on to plt.imshow. For instance you can set the colormap:

ps.visualization.imshow(im, axis=1, ind=10, cmap=plt.cm.plasma);
../../../_images/ee3a3de1b4883dba5b1ad18627f96134c16d27d073969b91e5382dce146bf698.png