Skip to content

Commit

Permalink
FIX: restore de-confliction logic for minor ticks
Browse files Browse the repository at this point in the history
In matplotlib#13363 when `iter_ticks` was deprecated the in-lined logic
did not account for the updates from matplotlib#13314.
  • Loading branch information
tacaswell committed Apr 12, 2019
1 parent dd18211 commit 8d4cee5
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/matplotlib/axis.py
Original file line number Diff line number Diff line change
Expand Up @@ -1064,17 +1064,18 @@ def _update_ticks(self):
Update ticks (position and labels) using the current data interval of
the axes. Return the list of ticks that will be drawn.
"""

major_locs = self.major.locator()
major_ticks = self.get_major_ticks(len(major_locs))
major_locs = self.get_majorticklocs()
major_labels = self.major.formatter.format_ticks(major_locs)
major_ticks = self.get_major_ticks(len(major_locs))
self.major.formatter.set_locs(major_locs)
for tick, loc, label in zip(major_ticks, major_locs, major_labels):
tick.update_position(loc)
tick.set_label1(label)
tick.set_label2(label)
minor_locs = self.minor.locator()
minor_ticks = self.get_minor_ticks(len(minor_locs))
minor_locs = self.get_minorticklocs()
minor_labels = self.minor.formatter.format_ticks(minor_locs)
minor_ticks = self.get_minor_ticks(len(minor_locs))
self.minor.formatter.set_locs(minor_locs)
for tick, loc, label in zip(minor_ticks, minor_locs, minor_labels):
tick.update_position(loc)
tick.set_label1(label)
Expand Down

0 comments on commit 8d4cee5

Please sign in to comment.