Skip to content

Avoid creating a Tick in Axis.get_tick_space. #17348

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 2 commits into from
May 17, 2020

Conversation

QuLogic
Copy link
Member

@QuLogic QuLogic commented May 7, 2020

PR Summary

Doing so is expensive, and triggers the figure to be marked stale. We don't need a whole tick, just the font size that it will eventually use, so calculate that directly.

Fixes #13971.

Also remove a redundant dictionary update.

PR Checklist

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

The `for` loop is supposed to check all fields in `kw` here, but `kw`
does not change, so doing `kwargs.update(kw)` in the loop is a waste.
@QuLogic QuLogic added this to the v3.3.0 milestone May 7, 2020
@jklymak
Copy link
Member

jklymak commented May 7, 2020

This looks reasonable to me, if that is really a piece of code that slows things down. That tick-spacing heuristic is only a hack anyway. I'll be curious if all the tests pass, though.

Copy link
Member

@efiring efiring left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

Doing so is expensive, and triggers the figure to be marked stale. We
don't need a whole tick, just the font size that it will eventually use,
so calculate that directly.
@QuLogic QuLogic force-pushed the tickspace-no-tick branch from 5404ee7 to 222b3ba Compare May 16, 2020 04:40
@timhoffm timhoffm merged commit 5c13fb4 into matplotlib:master May 17, 2020
@QuLogic QuLogic deleted the tickspace-no-tick branch May 17, 2020 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unnecessary drawing with NbAgg
4 participants