Skip to content

Commit 156a438

Browse files
nhansendevscottshambaugh
authored andcommitted
Added kwargs for depth-shading
1 parent 4f449c0 commit 156a438

File tree

1 file changed

+29
-6
lines changed

1 file changed

+29
-6
lines changed

lib/mpl_toolkits/mplot3d/axes3d.py

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2903,9 +2903,13 @@ def add_collection3d(self, col, zs=0, zdir='z', autolim=True, *,
29032903
@_preprocess_data(replace_names=["xs", "ys", "zs", "s",
29042904
"edgecolors", "c", "facecolor",
29052905
"facecolors", "color"])
2906-
def scatter(self, xs, ys,
2907-
zs=0, zdir='z', s=20, c=None, depthshade=True, *args,
2908-
axlim_clip=False, **kwargs):
2906+
def scatter(self, xs, ys, zs=0, zdir='z', s=20, c=None, depthshade=True,
2907+
depthshade_inverted=False,
2908+
depthshade_minalpha=0.3,
2909+
depthshade_legacy=False,
2910+
*args,
2911+
axlim_clip=False,
2912+
**kwargs):
29092913
"""
29102914
Create a scatter plot.
29112915
@@ -2941,12 +2945,24 @@ def scatter(self, xs, ys,
29412945
Whether to shade the scatter markers to give the appearance of
29422946
depth. Each call to ``scatter()`` will perform its depthshading
29432947
independently.
2948+
2949+
depthshade_inverted : bool, default: False
2950+
Whether to reverse the order of depth-shading transparency.
2951+
2952+
depthshade_minalpha : float, default: 0.3
2953+
The lowest alpha value applied by depth-shading.
2954+
2955+
depthshade_legacy : bool, default: False
2956+
Whether to use the legacy algorithm for depth-shading.
2957+
29442958
axlim_clip : bool, default: False
29452959
Whether to hide the scatter points outside the axes view limits.
29462960
29472961
.. versionadded:: 3.10
2962+
29482963
data : indexable object, optional
29492964
DATA_PARAMETER_PLACEHOLDER
2965+
29502966
**kwargs
29512967
All other keyword arguments are passed on to `~.axes.Axes.scatter`.
29522968
@@ -2972,9 +2988,16 @@ def scatter(self, xs, ys,
29722988
zs = zs.copy()
29732989

29742990
patches = super().scatter(xs, ys, s=s, c=c, *args, **kwargs)
2975-
art3d.patch_collection_2d_to_3d(patches, zs=zs, zdir=zdir,
2976-
depthshade=depthshade,
2977-
axlim_clip=axlim_clip)
2991+
art3d.patch_collection_2d_to_3d(
2992+
patches,
2993+
zs=zs,
2994+
zdir=zdir,
2995+
depthshade=depthshade,
2996+
depthshade_inverted=depthshade_inverted,
2997+
depthshade_minalpha=depthshade_minalpha,
2998+
depthshade_legacy=depthshade_legacy,
2999+
axlim_clip=axlim_clip,
3000+
)
29783001

29793002
if self._zmargin < 0.05 and xs.size > 0:
29803003
self.set_zmargin(0.05)

0 commit comments

Comments
 (0)