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
@@ -631,8 +631,8 @@ def __init__(
631631 * args ,
632632 zs = 0 ,
633633 zdir = "z" ,
634- depthshade = True ,
635- depthshade_minalpha = 0.3 ,
634+ depthshade = None ,
635+ depthshade_minalpha = None ,
636636 axlim_clip = False ,
637637 ** kwargs
638638 ):
@@ -654,6 +654,10 @@ def __init__(
654654 *depthshade_minalpha* sets the minimum alpha value applied by
655655 depth-shading.
656656 """
657+ if depthshade is None :
658+ depthshade = rcParams ['axes3d.depthshade' ]
659+ if depthshade_minalpha is None :
660+ depthshade_minalpha = rcParams ['axes3d.depthshade_minalpha' ]
657661 self ._depthshade = depthshade
658662 self ._depthshade_minalpha = depthshade_minalpha
659663 super ().__init__ (* args , ** kwargs )
@@ -665,7 +669,7 @@ def get_depthshade(self):
665669 def set_depthshade (
666670 self ,
667671 depthshade ,
668- depthshade_minalpha = 0.3 ,
672+ depthshade_minalpha = None ,
669673 ):
670674 """
671675 Set whether depth shading is performed on collection members.
@@ -675,9 +679,12 @@ def set_depthshade(
675679 depthshade : bool
676680 Whether to shade the patches in order to give the appearance of
677681 depth.
678- depthshade_minalpha : float
682+ depthshade_minalpha : float, default: None
679683 Sets the minimum alpha value used by depth-shading.
684+ If None, use the value from rcParams['axes3d.depthshade_minalpha'].
680685 """
686+ if depthshade_minalpha is None :
687+ depthshade_minalpha = rcParams ['axes3d.depthshade_minalpha' ]
681688 self ._depthshade = depthshade
682689 self ._depthshade_minalpha = depthshade_minalpha
683690 self .stale = True
@@ -782,8 +789,8 @@ def __init__(
782789 * args ,
783790 zs = 0 ,
784791 zdir = "z" ,
785- depthshade = True ,
786- depthshade_minalpha = 0.3 ,
792+ depthshade = None ,
793+ depthshade_minalpha = None ,
787794 axlim_clip = False ,
788795 ** kwargs
789796 ):
@@ -805,6 +812,10 @@ def __init__(
805812 *depthshade_minalpha* sets the minimum alpha value applied by
806813 depth-shading.
807814 """
815+ if depthshade is None :
816+ depthshade = rcParams ['axes3d.depthshade' ]
817+ if depthshade_minalpha is None :
818+ depthshade_minalpha = rcParams ['axes3d.depthshade_minalpha' ]
808819 self ._depthshade = depthshade
809820 self ._depthshade_minalpha = depthshade_minalpha
810821 self ._in_draw = False
@@ -888,7 +899,7 @@ def get_depthshade(self):
888899 def set_depthshade (
889900 self ,
890901 depthshade ,
891- depthshade_minalpha = 0.3 ,
902+ depthshade_minalpha = None ,
892903 ):
893904 """
894905 Set whether depth shading is performed on collection members.
@@ -901,6 +912,8 @@ def set_depthshade(
901912 depthshade_minalpha : float
902913 Sets the minimum alpha value used by depth-shading.
903914 """
915+ if depthshade_minalpha is None :
916+ depthshade_minalpha = rcParams ['axes3d.depthshade_minalpha' ]
904917 self ._depthshade = depthshade
905918 self ._depthshade_minalpha = depthshade_minalpha
906919 self .stale = True
@@ -991,10 +1004,10 @@ def patch_collection_2d_to_3d(
9911004 col ,
9921005 zs = 0 ,
9931006 zdir = "z" ,
994- depthshade = True ,
1007+ depthshade = None ,
9951008 axlim_clip = False ,
9961009 * args ,
997- depthshade_minalpha = 0.3
1010+ depthshade_minalpha = None ,
9981011):
9991012 """
10001013 Convert a `.PatchCollection` into a `.Patch3DCollection` object
@@ -1011,10 +1024,12 @@ def patch_collection_2d_to_3d(
10111024 zdir : {'x', 'y', 'z'}
10121025 The axis in which to place the patches. Default: "z".
10131026 See `.get_dir_vector` for a description of the values.
1014- depthshade
1015- Whether to shade the patches to give a sense of depth. Default: *True*.
1016- depthshade_minalpha
1017- Sets the minimum alpha value used by depth-shading. Default: 0.3.
1027+ depthshade : bool, default: None
1028+ Whether to shade the patches to give a sense of depth.
1029+ If None, use the value from rcParams['axes3d.depthshade'].
1030+ depthshade_minalpha : float, default: None
1031+ Sets the minimum alpha value used by depth-shading.
1032+ If None, use the value from rcParams['axes3d.depthshade_minalpha'].
10181033 axlim_clip : bool, default: False
10191034 Whether to hide patches with a vertex outside the axes view limits.
10201035 """
@@ -1023,6 +1038,10 @@ def patch_collection_2d_to_3d(
10231038 col ._offset_zordered = None
10241039 elif isinstance (col , PatchCollection ):
10251040 col .__class__ = Patch3DCollection
1041+ if depthshade is None :
1042+ depthshade = rcParams ['axes3d.depthshade' ]
1043+ if depthshade_minalpha is None :
1044+ depthshade_minalpha = rcParams ['axes3d.depthshade_minalpha' ]
10261045 col ._depthshade = depthshade
10271046 col ._depthshade_minalpha = depthshade_minalpha
10281047 col ._in_draw = False
0 commit comments