show_planes#

Create a quick montage showing a 3D image in all three directions.

[1]:
import matplotlib.pyplot as plt
import numpy as np
import porespy as ps
import inspect
ps.visualization.set_mpl_style()
inspect.signature(ps.visualization.show_planes)
[1]:
<Signature (im, spacing=10)>

im#

The input image is 3D array to be veiwed in three directions. Note that the method does not work for 2D arrays as input. Note that the upper left image shows the xy plane at z=(image length in z dir/2). The lower left image shows the xz plane at y=(image length in y dir/2). The upper right image shows the yz plane at x=(image length in x dir/2).

[2]:
im = ps.generators.blobs(shape=[40, 40, 40])
planes = ps.visualization.show_planes(im)
fig, ax = plt.subplots(1, 1, figsize=[8, 8])
ax.imshow(planes)
ax.axis(False);
../../../_images/examples_visualization_reference_show_planes_4_0.svg

spacing#

This parameter defines the amount of space to put between each plane. The default spacing is 10.

[3]:
planes = ps.visualization.show_planes(im, spacing = 2)
fig, ax = plt.subplots(1, 1, figsize=[8, 8])
ax.imshow(planes)
ax.axis(False);
../../../_images/examples_visualization_reference_show_planes_7_0.svg