MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / voxels

Method voxels

lib/mpl_toolkits/mplot3d/axes3d.py:3612–3825  ·  view source on GitHub ↗

ax.voxels([x, y, z,] /, filled, facecolors=None, edgecolors=None, \ **kwargs) Plot a set of filled voxels All voxels are plotted as 1x1x1 cubes on the axis, with ``filled[0, 0, 0]`` placed with its lower corner at the origin. Occluded faces are not plotted.

(self, *args, facecolors=None, edgecolors=None, shade=True,
               lightsource=None, axlim_clip=False, **kwargs)

Source from the content-addressed store, hash-verified

3610 quiver3D = quiver
3611
3612 def voxels(self, *args, facecolors=None, edgecolors=None, shade=True,
3613 lightsource=None, axlim_clip=False, **kwargs):
3614 """
3615 ax.voxels([x, y, z,] /, filled, facecolors=None, edgecolors=None, \
3616**kwargs)
3617
3618 Plot a set of filled voxels
3619
3620 All voxels are plotted as 1x1x1 cubes on the axis, with
3621 ``filled[0, 0, 0]`` placed with its lower corner at the origin.
3622 Occluded faces are not plotted.
3623
3624 Parameters
3625 ----------
3626 filled : 3D np.array of bool
3627 A 3D array of values, with truthy values indicating which voxels
3628 to fill
3629
3630 x, y, z : 3D np.array, optional
3631 The coordinates of the corners of the voxels. This should broadcast
3632 to a shape one larger in every dimension than the shape of
3633 *filled*. These can be used to plot non-cubic voxels.
3634
3635 If not specified, defaults to increasing integers along each axis,
3636 like those returned by :func:`~numpy.indices`.
3637 As indicated by the ``/`` in the function signature, these
3638 arguments can only be passed positionally.
3639
3640 facecolors, edgecolors : array-like, optional
3641 The color to draw the faces and edges of the voxels. Can only be
3642 passed as keyword arguments.
3643 These parameters can be:
3644
3645 - A single color value, to color all voxels the same color. This
3646 can be either a string, or a 1D RGB/RGBA array
3647 - ``None``, the default, to use a single color for the faces, and
3648 the style default for the edges.
3649 - A 3D `~numpy.ndarray` of color names, with each item the color
3650 for the corresponding voxel. The size must match the voxels.
3651 - A 4D `~numpy.ndarray` of RGB/RGBA data, with the components
3652 along the last axis.
3653
3654 shade : bool, default: True
3655 Whether to shade the facecolors.
3656
3657 lightsource : `~matplotlib.colors.LightSource`, optional
3658 The lightsource to use when *shade* is True.
3659
3660 axlim_clip : bool, default: False
3661 Whether to hide voxels with points outside the axes view limits.
3662
3663 .. versionadded:: 3.10
3664
3665 **kwargs
3666 Additional keyword arguments to pass onto
3667 `~mpl_toolkits.mplot3d.art3d.Poly3DCollection`.
3668
3669 Returns

Callers 12

test_simpleMethod · 0.80
test_edge_styleMethod · 0.80
test_named_colorsMethod · 0.80
test_rgb_dataMethod · 0.80
test_alphaMethod · 0.80
test_xyzMethod · 0.80
voxels_simple.pyFile · 0.80
voxels_rgb.pyFile · 0.80
voxels_torus.pyFile · 0.80
voxels.pyFile · 0.80

Calls 4

auto_scale_xyzMethod · 0.95
add_collection3dMethod · 0.95
dotMethod · 0.80
get_next_colorMethod · 0.45

Tested by 7

test_simpleMethod · 0.64
test_edge_styleMethod · 0.64
test_named_colorsMethod · 0.64
test_rgb_dataMethod · 0.64
test_alphaMethod · 0.64
test_xyzMethod · 0.64