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

Skip to content

Commit 7680c19

Browse files
committed
FIX: restore de-confliction logic for minor ticks
In #13363 when `iter_ticks` was deprecated the in-lined logic did not account for the updates from #13314.
1 parent 019aeea commit 7680c19

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lib/matplotlib/axis.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,19 +1064,18 @@ def _update_ticks(self):
10641064
Update ticks (position and labels) using the current data interval of
10651065
the axes. Return the list of ticks that will be drawn.
10661066
"""
1067-
1068-
major_locs = self.major.locator()
1067+
major_locs = self.get_majorticklocs()
1068+
major_labels = self.major.formatter.format_ticks(major_locs)
10691069
major_ticks = self.get_major_ticks(len(major_locs))
10701070
self.major.formatter.set_locs(major_locs)
1071-
major_labels = self.major.formatter.format_ticks(major_locs)
10721071
for tick, loc, label in zip(major_ticks, major_locs, major_labels):
10731072
tick.update_position(loc)
10741073
tick.set_label1(label)
10751074
tick.set_label2(label)
1076-
minor_locs = self.minor.locator()
1075+
minor_locs = self.get_minorticklocs()
1076+
minor_labels = self.minor.formatter.format_ticks(minor_locs)
10771077
minor_ticks = self.get_minor_ticks(len(minor_locs))
10781078
self.minor.formatter.set_locs(minor_locs)
1079-
minor_labels = self.minor.formatter.format_ticks(minor_locs)
10801079
for tick, loc, label in zip(minor_ticks, minor_locs, minor_labels):
10811080
tick.update_position(loc)
10821081
tick.set_label1(label)

0 commit comments

Comments
 (0)