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

Skip to content

FIX: do not try to manage the visibility of un-drawn ticks #14056

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
merged 1 commit into from
Apr 29, 2019

Conversation

tacaswell
Copy link
Member

This reverts part of the changes from #13908 (in particular commit
e908efe ) that tried to manage the
visibility if the ticks that are not used. However, there was a bug
in this that nothing would ever set ticks to be visible
again. Because we currently cache / recycle ticks this meant that
panning / zooming or resizing the figure would eventually lose ticks
if the number of ticks ever went down and then back up.

We could fix this by adding a tick.set_visible(True) for the drawn
ticks, however this would break the (brittle) use case where users are
reaching in and manually setting the visibility of individual ticks to
False to hide them.

Instead, we revert the consistency code altogether and accept that
there will be Tick objects in Axis.majorTicks and
Axis.minorTicks that are marked as visible, but are not
drawn (because they are filtered by _update_ticks).

Closes #14054

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code is Flake 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

This reverts part of the changes from matplotlib#13908 (in particular commit
e908efe ) that tried to manage the
visibility if the ticks that are not used.  However, there was a bug
in this that nothing would ever set ticks to be visible
again.  Because we currently cache / recycle ticks this meant that
panning / zooming or resizing the figure would eventually lose ticks
if the number of ticks ever went down and then back up.

We could fix this by adding a `tick.set_visible(True)` for the drawn
ticks, however this would break the (brittle) use case where users are
reaching in and manually setting the visibility of individual ticks to
False to hide them.

Instead, we revert the consistency code altogether and accept that
there will be `Tick` objects in `Axis.majorTicks` and
`Axis.minorTicks` that are marked as visible, but are not
drawn (because they are filtered by `_update_ticks`).

Closes matplotlib#14054
@tacaswell tacaswell added this to the v3.1.0 milestone Apr 26, 2019
@tacaswell tacaswell added the Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. label Apr 26, 2019
@anntzer anntzer merged commit 6f20709 into matplotlib:master Apr 29, 2019
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Apr 29, 2019
dstansby added a commit that referenced this pull request Apr 29, 2019
…056-on-v3.1.x

Backport PR #14056 on branch v3.1.x (FIX: do not try to manage the visibility of un-drawn ticks)
@tacaswell tacaswell deleted the fix_tick_visibility branch May 1, 2019 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ticks sometimes disappear when zooming interactively
3 participants