@@ -1155,26 +1155,22 @@ def __init__(self, xranges, yrange, **kwargs):
11551155 (xmin , ymin )] for xmin , xwidth in xranges ]
11561156 PolyCollection .__init__ (self , verts , ** kwargs )
11571157
1158- @staticmethod
1159- def span_where (x , ymin , ymax , where , ** kwargs ):
1158+ @classmethod
1159+ def span_where (cls , x , ymin , ymax , where , ** kwargs ):
11601160 """
1161- Create a BrokenBarHCollection to plot horizontal bars from
1161+ Return a ` BrokenBarHCollection` that plots horizontal bars from
11621162 over the regions in *x* where *where* is True. The bars range
11631163 on the y-axis from *ymin* to *ymax*
11641164
1165- A :class:`BrokenBarHCollection` is returned. *kwargs* are
1166- passed on to the collection.
1165+ *kwargs* are passed on to the collection.
11671166 """
11681167 xranges = []
11691168 for ind0 , ind1 in cbook .contiguous_regions (where ):
11701169 xslice = x [ind0 :ind1 ]
11711170 if not len (xslice ):
11721171 continue
11731172 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 )
11781174
11791175
11801176class RegularPolyCollection (_CollectionWithSizes ):
0 commit comments