1515
1616from matplotlib import (
1717 _api , artist , cbook , colors as mcolors , lines , text as mtext ,
18- path as mpath )
18+ path as mpath , rcParams )
1919from matplotlib .collections import (
2020 Collection , LineCollection , PolyCollection , PatchCollection , PathCollection )
2121from matplotlib .patches import Patch
@@ -647,8 +647,8 @@ def __init__(
647647 * args ,
648648 zs = 0 ,
649649 zdir = "z" ,
650- depthshade = True ,
651- depthshade_minalpha = 0.3 ,
650+ depthshade = None ,
651+ depthshade_minalpha = None ,
652652 axlim_clip = False ,
653653 ** kwargs
654654 ):
@@ -670,6 +670,10 @@ def __init__(
670670 *depthshade_minalpha* sets the minimum alpha value applied by
671671 depth-shading.
672672 """
673+ if depthshade is None :
674+ depthshade = rcParams ['axes3d.depthshade' ]
675+ if depthshade_minalpha is None :
676+ depthshade_minalpha = rcParams ['axes3d.depthshade_minalpha' ]
673677 self ._depthshade = depthshade
674678 self ._depthshade_minalpha = depthshade_minalpha
675679 super ().__init__ (* args , ** kwargs )
@@ -681,7 +685,7 @@ def get_depthshade(self):
681685 def set_depthshade (
682686 self ,
683687 depthshade ,
684- depthshade_minalpha = 0.3 ,
688+ depthshade_minalpha = None ,
685689 ):
686690 """
687691 Set whether depth shading is performed on collection members.
@@ -691,9 +695,12 @@ def set_depthshade(
691695 depthshade : bool
692696 Whether to shade the patches in order to give the appearance of
693697 depth.
694- depthshade_minalpha : float
698+ depthshade_minalpha : float, default: None
695699 Sets the minimum alpha value used by depth-shading.
700+ If None, use the value from rcParams['axes3d.depthshade_minalpha'].
696701 """
702+ if depthshade_minalpha is None :
703+ depthshade_minalpha = rcParams ['axes3d.depthshade_minalpha' ]
697704 self ._depthshade = depthshade
698705 self ._depthshade_minalpha = depthshade_minalpha
699706 self .stale = True
@@ -813,8 +820,8 @@ def __init__(
813820 * args ,
814821 zs = 0 ,
815822 zdir = "z" ,
816- depthshade = True ,
817- depthshade_minalpha = 0.3 ,
823+ depthshade = None ,
824+ depthshade_minalpha = None ,
818825 axlim_clip = False ,
819826 ** kwargs
820827 ):
@@ -836,6 +843,10 @@ def __init__(
836843 *depthshade_minalpha* sets the minimum alpha value applied by
837844 depth-shading.
838845 """
846+ if depthshade is None :
847+ depthshade = rcParams ['axes3d.depthshade' ]
848+ if depthshade_minalpha is None :
849+ depthshade_minalpha = rcParams ['axes3d.depthshade_minalpha' ]
839850 self ._depthshade = depthshade
840851 self ._depthshade_minalpha = depthshade_minalpha
841852 self ._in_draw = False
@@ -919,7 +930,7 @@ def get_depthshade(self):
919930 def set_depthshade (
920931 self ,
921932 depthshade ,
922- depthshade_minalpha = 0.3 ,
933+ depthshade_minalpha = None ,
923934 ):
924935 """
925936 Set whether depth shading is performed on collection members.
@@ -932,6 +943,8 @@ def set_depthshade(
932943 depthshade_minalpha : float
933944 Sets the minimum alpha value used by depth-shading.
934945 """
946+ if depthshade_minalpha is None :
947+ depthshade_minalpha = rcParams ['axes3d.depthshade_minalpha' ]
935948 self ._depthshade = depthshade
936949 self ._depthshade_minalpha = depthshade_minalpha
937950 self .stale = True
@@ -1029,10 +1042,10 @@ def patch_collection_2d_to_3d(
10291042 col ,
10301043 zs = 0 ,
10311044 zdir = "z" ,
1032- depthshade = True ,
1045+ depthshade = None ,
10331046 axlim_clip = False ,
10341047 * args ,
1035- depthshade_minalpha = 0.3
1048+ depthshade_minalpha = None ,
10361049):
10371050 """
10381051 Convert a `.PatchCollection` into a `.Patch3DCollection` object
@@ -1049,10 +1062,12 @@ def patch_collection_2d_to_3d(
10491062 zdir : {'x', 'y', 'z'}
10501063 The axis in which to place the patches. Default: "z".
10511064 See `.get_dir_vector` for a description of the values.
1052- depthshade
1053- Whether to shade the patches to give a sense of depth. Default: *True*.
1054- depthshade_minalpha
1055- Sets the minimum alpha value used by depth-shading. Default: 0.3.
1065+ depthshade : bool, default: None
1066+ Whether to shade the patches to give a sense of depth.
1067+ If None, use the value from rcParams['axes3d.depthshade'].
1068+ depthshade_minalpha : float, default: None
1069+ Sets the minimum alpha value used by depth-shading.
1070+ If None, use the value from rcParams['axes3d.depthshade_minalpha'].
10561071 axlim_clip : bool, default: False
10571072 Whether to hide patches with a vertex outside the axes view limits.
10581073 """
@@ -1061,6 +1076,10 @@ def patch_collection_2d_to_3d(
10611076 col ._offset_zordered = None
10621077 elif isinstance (col , PatchCollection ):
10631078 col .__class__ = Patch3DCollection
1079+ if depthshade is None :
1080+ depthshade = rcParams ['axes3d.depthshade' ]
1081+ if depthshade_minalpha is None :
1082+ depthshade_minalpha = rcParams ['axes3d.depthshade_minalpha' ]
10641083 col ._depthshade = depthshade
10651084 col ._depthshade_minalpha = depthshade_minalpha
10661085 col ._in_draw = False
0 commit comments