@@ -211,8 +211,6 @@ def get_datalim(self, transData):
211
211
# we may have transform.contains_branch(transData) but not
212
212
# transforms.get_affine().contains_branch(transData). But later,
213
213
# be careful to only apply the affine part that remains.
214
- if not transOffset .is_affine :
215
- offsets = transOffset .transform_non_affine (offsets )
216
214
217
215
if isinstance (offsets , np .ma .MaskedArray ):
218
216
offsets = offsets .filled (np .nan )
@@ -226,17 +224,18 @@ def get_datalim(self, transData):
226
224
# also use this algorithm (like streamplot).
227
225
result = mpath .get_path_collection_extents (
228
226
transform .get_affine (), paths , self .get_transforms (),
229
- offsets , transOffset .get_affine ().frozen ())
227
+ transOffset .transform_non_affine (offsets ),
228
+ transOffset .get_affine ().frozen ())
230
229
return result .transformed (transData .inverted ())
231
230
if not self ._offsetsNone :
232
231
# this is for collections that have their paths (shapes)
233
232
# in physical, axes-relative, or figure-relative units
234
233
# (i.e. like scatter). We can't uniquely set limits based on
235
234
# those shapes, so we just set the limits based on their
236
235
# location.
237
- # Finish the transform:
238
- offsets = (transOffset . get_affine () +
239
- transData . inverted ()). transform ( offsets )
236
+
237
+ offsets = (transOffset - transData ). transform ( offsets )
238
+ # note A-B means A B^{-1}
240
239
offsets = np .ma .masked_invalid (offsets )
241
240
if not offsets .mask .all ():
242
241
points = np .row_stack ((offsets .min (axis = 0 ),
0 commit comments