imshow#

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

import matplotlib.pyplot as plt

import porespy as ps

ps.visualization.set_mpl_style()

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/af749133562578c4425057fc8286ce9fb909f490293eee550f75084479bb7c7a.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/f878249be3bee3eff17dd994a7c544bb2f9e252fd9642cf2fd0c54a94a0f1141.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/0c9dd0b674afd3146f55e9f1a62f2d6aef0f4aa8edbd6c4dd6e1abfc5eda6d91.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/ea833fb0205286827734b69823051279e0014580fa7a20a4c54ad3af2a8f76c2.png