Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2ee3e6d

Browse files
committed
FIX: re-add AssertionError check
1 parent 8104b16 commit 2ee3e6d

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

lib/matplotlib/axis.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1045,7 +1045,13 @@ def _update_ticks(self, renderer):
10451045
tick.update_position(loc)
10461046
tick.set_label1(label)
10471047
tick.set_label2(label)
1048-
loct = self.get_transform().transform(loc)
1048+
try:
1049+
loct = self.get_transform().transform(loc)
1050+
except AssertionError:
1051+
# transforms.transform doesn't allow masked values but
1052+
# some scales might make them, so we need this try/except.
1053+
loct = None
1054+
continue
10491055
if not mtransforms.interval_contains_close(inter, loct):
10501056
continue
10511057
ticks_to_draw.append(tick)

lib/matplotlib/transforms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2917,7 +2917,7 @@ def interval_contains(interval, val):
29172917
def interval_contains_close(interval, val, rtol=1e-10):
29182918
"""
29192919
Check, inclusively, whether an interval includes a given value, with the
2920-
interval expanded by a small tolerance to admit floating point errors.
2920+
interval expanded by a small tolerance to admit floating point errors.
29212921
29222922
Parameters
29232923
----------

0 commit comments

Comments
 (0)