mpl_toolkits.mplot3d.axes3d.Axes3D.voxels#
- Axes3D.voxels([x,y,z,]/,filled,facecolors=None,edgecolors=None,**kwargs)[source]#
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.- Parameters:
- filled3D np.array of bool
A 3D array of values, with truthy values indicating which voxelsto fill
- x, y, z3D np.array, optional
The coordinates of the corners of the voxels. This should broadcastto a shape one larger in every dimension than the shape offilled. These can be used to plot non-cubic voxels.
If not specified, defaults to increasing integers along each axis,like those returned by
indices().As indicated by the/in the function signature, thesearguments can only be passed positionally.- facecolors, edgecolorsarray-like, optional
The color to draw the faces and edges of the voxels. Can only bepassed as keyword arguments.These parameters can be:
A single color value, to color all voxels the same color. Thiscan be either a string, or a 1D RGB/RGBA array
None, the default, to use a single color for the faces, andthe style default for the edges.A 3D
ndarrayof color names, with each item the colorfor the corresponding voxel. The size must match the voxels.A 4D
ndarrayof RGB/RGBA data, with the componentsalong the last axis.
- shadebool, default: True
Whether to shade the facecolors.
- lightsource
LightSource, optional The lightsource to use whenshade is True.
- axlim_clipbool, default: False
Whether to hide voxels with points outside the axes view limits.
Added in version 3.10.
- **kwargs
Additional keyword arguments to pass onto
Poly3DCollection.
- Returns:
- facesdict
A dictionary indexed by coordinate, where
faces[i,j,k]is aPoly3DCollectionof the faces drawn for the voxelfilled[i,j,k]. If no faces were drawn for a given voxel,either because it was not asked to be drawn, or it is fullyoccluded, then(i,j,k)notinfaces.
Examples




Examples usingmpl_toolkits.mplot3d.axes3d.Axes3D.voxels#
3D voxel / volumetric plot with cylindrical coordinates