Skip to content

Commit 229b49e

Browse files
committed
FIX: bypass inverse in collection
1 parent ee2d046 commit 229b49e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/matplotlib/collections.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,13 @@ def get_datalim(self, transData):
234234
# (i.e. like scatter). We can't uniquely set limits based on
235235
# those shapes, so we just set the limits based on their
236236
# location.
237-
# Finish the transform:
238-
offsets = (transOffset.get_affine() +
239-
transData.inverted()).transform(offsets)
237+
print('Hiiii', (transOffset == transData))
238+
239+
if not (transOffset.is_affine and (transOffset == transData)):
240+
# Finish the transform started above, but only
241+
# if we have to (to save floating point precision)
242+
offsets = (transOffset.get_affine() +
243+
transData.inverted()).transform(offsets)
240244
offsets = np.ma.masked_invalid(offsets)
241245
if not offsets.mask.all():
242246
points = np.row_stack((offsets.min(axis=0),

0 commit comments

Comments
 (0)