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

Skip to content

Commit 7683550

Browse files
committed
FIX: trasnfrom data first so that the values are in screen space
1 parent 0a771cc commit 7683550

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

lib/matplotlib/axis.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,8 +1063,10 @@ def _update_ticks(self, renderer):
10631063
tick.update_position(loc)
10641064
tick.set_label1(label)
10651065
tick.set_label2(label)
1066-
if not mtransforms.interval_contains(interval, loc):
1067-
continue
1066+
inter = self.get_transform().transform(interval)
1067+
loct = self.get_transform().transform(loc)
1068+
if not mtransforms.interval_contains(inter, loct):
1069+
continue
10681070
ticks_to_draw.append(tick)
10691071

10701072
return ticks_to_draw

lib/matplotlib/ticker.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ def _keep_in_vlim(locs, vmin, vmax, rtol=1e-10):
198198
vmax, vmin = vmin, vmax
199199

200200
rtol = (vmax - vmin) * rtol
201+
print(vmin, rtol)
201202
locs = locs[locs >= vmin - rtol]
202203
locs = locs[locs <= vmax + rtol]
203204
return locs

0 commit comments

Comments
 (0)