Skip to content

Commit a53833e

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

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/matplotlib/collections.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,11 @@ 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+
if not (transOffset.is_affine and (transOffset == transData)):
238+
# Finish the transform started above, but only
239+
# if we have to (to save floating point precision)
240+
offsets = (transOffset.get_affine() +
241+
transData.inverted()).transform(offsets)
240242
offsets = np.ma.masked_invalid(offsets)
241243
if not offsets.mask.all():
242244
points = np.row_stack((offsets.min(axis=0),

0 commit comments

Comments
 (0)