ThreeDViewer.image.plot_3d#

plot_3d(data, fig=None, init_take=1, init_slice=0, axial=False, save=None, const_color=False, arrow_skip=0, show=True, axes_names=('x', 'y', 'z'), **kwargs)#

Plots a 3D scalar or vector field, with the possibility to slice along different axes.

Plotting maintains a right-handed axis system, looking down from the slicing axis.

Parameters:
datanp.ndarray

The 3D scalar or vector field to plot.

figmatplotlib.figure.Figure (optional)

Matplotlib figure to use (by default a new figure will be created).

init_takeint (optional)

Initial slicing direction (0, 1, 2) corresponding to the (x, y, z) spatial dimensions.

init_sliceint (optional)

Initial slice index.

axialbool (optional)

True for orientation field coloring, False for vector field coloring.

savestr (optional)

Filename to save a snapshot of the figure.

const_colorbool (optional)

Vector coloring will remain the same regardless of the slicing axis when True.

arrow_skipint (optional)

Add arrows to the plot, 0 implies no arrows.

showbool (optional)

True to show figure, false will maintain the figure for plotting later with plt.show().

axes_names3-tuple of string (optional)

Axis names to use for plotting.

Returns:
Slider, Slider (optional)

Slice and axis slider objects, necessary to maintain interactivity when show is set to False.

Other Parameters:
kwargsmatplotlib.artist.Artist properties

Additional keyword arguments for matplotlib (e.g. cmap).