Skip to content

Commit 0a2f069

Browse files
committed
DOC: add clearer call signatures
1 parent 50d9070 commit 0a2f069

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed

lib/mpl_toolkits/mplot3d/axes3d.py

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2756,6 +2756,11 @@ def voxels(self, *args, **kwargs):
27562756
placed with its lower corner at the origin. Occluded faces are not
27572757
plotted.
27582758
2759+
Call signatures::
2760+
2761+
voxels(filled, facecolors=fc, edgecolors=ec, **kwargs)
2762+
voxels(x, y, z, filled, facecolors=fc, edgecolors=ec, **kwargs)
2763+
27592764
.. versionadded:: 2.1
27602765
27612766
Parameters
@@ -2767,23 +2772,30 @@ def voxels(self, *args, **kwargs):
27672772
x, y, z : 3D np.array, optional
27682773
The coordinates of the corners of the voxels. This should broadcast
27692774
to a shape one larger in every dimension than the shape of `filled`.
2770-
These arguments can be used to plot non-cubic voxels.
2771-
If not specified, defaults to increasing integers along each axis.
2775+
These can be used to plot non-cubic voxels.
27722776
2773-
facecolors, edgecolors : array_like
2774-
The color to draw the faces and edges of the voxels. This parameter
2775-
can be:
2777+
If not specified, defaults to increasing integers along each axis,
2778+
like those returned by :func:`~numpy.indices`.
2779+
As indicated by the ``/`` in the function signature, these arguments
2780+
can only be passed positionally.
2781+
2782+
facecolors, edgecolors : array_like, optional
2783+
The color to draw the faces and edges of the voxels. Can only be
2784+
passed as keyword arguments.
2785+
This parameter can be:
27762786
27772787
- A single color value, to color all voxels the same color. This
27782788
can be either a string, or a 1D rgb/rgba array
2779-
- ``None``, indicating to use the default
2789+
- ``None``, the default, to use a single color for the faces, and
2790+
the style default for the edges.
27802791
- A 3D ndarray of color names, with each item the color for the
27812792
corresponding voxel. The size must match the voxels.
27822793
- A 4D ndarray of rgb/rgba data, with the components along the
27832794
last axis.
27842795
2785-
Any additional keyword arguments are passed onto
2786-
:func:`~mpl_toolkits.mplot3d.art3d.Poly3DCollection`
2796+
**kwargs
2797+
Additional keyword arguments to pass onto
2798+
:func:`~mpl_toolkits.mplot3d.art3d.Poly3DCollection`
27872799
27882800
Returns
27892801
-------
@@ -2796,7 +2808,6 @@ def voxels(self, *args, **kwargs):
27962808
27972809
Examples
27982810
--------
2799-
28002811
.. plot:: gallery/mplot3d/voxels.py
28012812
.. plot:: gallery/mplot3d/voxels_rgb.py
28022813
.. plot:: gallery/mplot3d/voxels_torus.py

0 commit comments

Comments
 (0)