@@ -274,11 +274,11 @@ def get_datalim(self, transData):
274274 # can properly have the axes limits set by their shape +
275275 # offset. LineCollections that have no offsets can
276276 # also use this algorithm (like streamplot).
277- result = mpath .get_path_collection_extents (
278- transform .get_affine (), paths , self .get_transforms (),
277+ return mpath .get_path_collection_extents (
278+ transform .get_affine () - transData , paths ,
279+ self .get_transforms (),
279280 transOffset .transform_non_affine (offsets ),
280281 transOffset .get_affine ().frozen ())
281- return result .transformed (transData .inverted ())
282282 if not self ._offsetsNone :
283283 # this is for collections that have their paths (shapes)
284284 # in physical, axes-relative, or figure-relative units
@@ -290,9 +290,9 @@ def get_datalim(self, transData):
290290 # note A-B means A B^{-1}
291291 offsets = np .ma .masked_invalid (offsets )
292292 if not offsets .mask .all ():
293- points = np . row_stack (( offsets . min ( axis = 0 ),
294- offsets . max ( axis = 0 )) )
295- return transforms . Bbox ( points )
293+ bbox = transforms . Bbox . null ()
294+ bbox . update_from_data_xy ( offsets )
295+ return bbox
296296 return transforms .Bbox .null ()
297297
298298 def get_window_extent (self , renderer ):
0 commit comments