@@ -1155,26 +1155,22 @@ def __init__(self, xranges, yrange, **kwargs):
1155
1155
(xmin , ymin )] for xmin , xwidth in xranges ]
1156
1156
PolyCollection .__init__ (self , verts , ** kwargs )
1157
1157
1158
- @staticmethod
1159
- def span_where (x , ymin , ymax , where , ** kwargs ):
1158
+ @classmethod
1159
+ def span_where (cls , x , ymin , ymax , where , ** kwargs ):
1160
1160
"""
1161
- Create a BrokenBarHCollection to plot horizontal bars from
1161
+ Return a ` BrokenBarHCollection` that plots horizontal bars from
1162
1162
over the regions in *x* where *where* is True. The bars range
1163
1163
on the y-axis from *ymin* to *ymax*
1164
1164
1165
- A :class:`BrokenBarHCollection` is returned. *kwargs* are
1166
- passed on to the collection.
1165
+ *kwargs* are passed on to the collection.
1167
1166
"""
1168
1167
xranges = []
1169
1168
for ind0 , ind1 in cbook .contiguous_regions (where ):
1170
1169
xslice = x [ind0 :ind1 ]
1171
1170
if not len (xslice ):
1172
1171
continue
1173
1172
xranges .append ((xslice [0 ], xslice [- 1 ] - xslice [0 ]))
1174
-
1175
- collection = BrokenBarHCollection (
1176
- xranges , [ymin , ymax - ymin ], ** kwargs )
1177
- return collection
1173
+ return cls (xranges , [ymin , ymax - ymin ], ** kwargs )
1178
1174
1179
1175
1180
1176
class RegularPolyCollection (_CollectionWithSizes ):
0 commit comments