@@ -49,6 +49,8 @@ class Collection(artist.Artist, cm.ScalarMappable):
49
49
* *cmap*: None (optional for
50
50
:class:`matplotlib.cm.ScalarMappable`)
51
51
* *hatch*: None
52
+ * *zorder*: 1
53
+
52
54
53
55
*offsets* and *transOffset* are used to translate the patch after
54
56
rendering (default no offsets). If offset_position is 'screen'
@@ -72,7 +74,7 @@ class Collection(artist.Artist, cm.ScalarMappable):
72
74
_transOffset = transforms .IdentityTransform ()
73
75
_transforms = []
74
76
75
- zorder = 1
77
+
76
78
77
79
def __init__ (self ,
78
80
edgecolors = None ,
@@ -88,6 +90,7 @@ def __init__(self,
88
90
hatch = None ,
89
91
urls = None ,
90
92
offset_position = 'screen' ,
93
+ zorder = 1 ,
91
94
** kwargs
92
95
):
93
96
"""
@@ -107,7 +110,8 @@ def __init__(self,
107
110
self .set_urls (urls )
108
111
self .set_hatch (hatch )
109
112
self .set_offset_position (offset_position )
110
-
113
+ self .set_zorder (zorder )
114
+
111
115
self ._uniform_offsets = None
112
116
self ._offsets = np .array ([], np .float_ )
113
117
# Force _offsets to be Nx2
@@ -897,7 +901,7 @@ class LineCollection(Collection):
897
901
i.e., the properties cycle if the ``len`` of props is less than the
898
902
number of segments.
899
903
"""
900
- zorder = 2
904
+
901
905
902
906
def __init__ (self , segments , # Can be None.
903
907
linewidths = None ,
@@ -909,6 +913,7 @@ def __init__(self, segments, # Can be None.
909
913
norm = None ,
910
914
cmap = None ,
911
915
pickradius = 5 ,
916
+ zorder = 2 ,
912
917
** kwargs
913
918
):
914
919
"""
@@ -959,6 +964,9 @@ def __init__(self, segments, # Can be None.
959
964
*pickradius* is the tolerance for mouse clicks picking a line.
960
965
The default is 5 pt.
961
966
967
+ *zorder*
968
+ The zorder of the LineCollection. Default is 2
969
+
962
970
The use of :class:`~matplotlib.cm.ScalarMappable` is optional.
963
971
If the :class:`~matplotlib.cm.ScalarMappable` array
964
972
:attr:`~matplotlib.cm.ScalarMappable._A` is not None (ie a call to
@@ -987,6 +995,7 @@ def __init__(self, segments, # Can be None.
987
995
norm = norm ,
988
996
cmap = cmap ,
989
997
pickradius = pickradius ,
998
+ zorder = zorder ,
990
999
** kwargs )
991
1000
992
1001
self .set_segments (segments )
0 commit comments