imshow#

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

[1]:
import porespy as ps
import matplotlib.pyplot as plt
ps.visualization.set_mpl_style()

im#

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

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

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.

[3]:
ps.visualization.imshow(im, axis=1);
../../../_images/examples_visualization_reference_imshow_5_0.svg

ind#

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

[4]:
ps.visualization.imshow(im, axis=1, ind=10);
../../../_images/examples_visualization_reference_imshow_7_0.svg

kwargs#

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

[5]:
ps.visualization.imshow(im, axis=1, ind=10, cmap=plt.cm.plasma);
../../../_images/examples_visualization_reference_imshow_9_0.svg