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

Skip to content

Backport PR #14056 on branch v3.1.x (FIX: do not try to manage the visibility of un-drawn ticks) #14092

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions lib/matplotlib/axis.py
Original file line number Diff line number Diff line change
Expand Up @@ -1095,11 +1095,6 @@ def _update_ticks(self):
tick.set_label2(label)
ticks = [*major_ticks, *minor_ticks]

# mark the ticks that we will not be using as not visible
for t in (self.minorTicks[len(minor_locs):] +
self.majorTicks[len(major_locs):]):
t.set_visible(False)

view_low, view_high = self.get_view_interval()
if view_low > view_high:
view_low, view_high = view_high, view_low
Expand Down
6 changes: 0 additions & 6 deletions lib/matplotlib/tests/test_ticker.py
Original file line number Diff line number Diff line change
Expand Up @@ -965,9 +965,3 @@ def test_remove_overlap(remove_overlapping_locs, expected_num):
assert len(ax.xaxis.get_minor_ticks()) == expected_num
assert len(ax.xaxis.get_minorticklabels()) == expected_num
assert len(ax.xaxis.get_minorticklines()) == expected_num*2

# force a draw to call _update_ticks under the hood
fig.canvas.draw()
# check that the correct number of ticks report them selves as
# visible
assert sum(t.get_visible() for t in ax.xaxis.minorTicks) == expected_num