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

Skip to content

Move notify_axes_change to FigureManagerBase class. #10607

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 4, 2018

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Feb 26, 2018

... instead of duplicating it across backends. The additional cost on
non-interactive backends is likely negligible.

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code is PEP 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

... instead of duplicating it across backends.  The additional cost on
non-interactive backends is likely negligible.
@anntzer anntzer added this to the v3.0 milestone Feb 26, 2018
def notify_axes_change(fig):
'this will be called whenever the current axes is changed'
if self.tb is not None:
self.tb.update()
Copy link
Member

Choose a reason for hiding this comment

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

Won't this cause problems here because the tool bar is self.tb and not self.toolbar like all the other backends?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is already aliased to toolbar too (in fact I'm getting rid of the tb alias in a separate PR).

Copy link
Member

@tacaswell tacaswell left a comment

Choose a reason for hiding this comment

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

The method needs to still be available.

self.toolbar = None

@self.canvas.figure.add_axobserver
def notify_axes_change(fig):
Copy link
Member

Choose a reason for hiding this comment

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

This also removes the method from all of the sub-classes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What method?

Copy link
Member

Choose a reason for hiding this comment

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

🐑 never mind, I thought this was a top-level method.

@tacaswell tacaswell dismissed their stale review February 26, 2018 21:32

I can not count spaces

@timhoffm timhoffm merged commit 945ffa4 into matplotlib:master Apr 4, 2018
@anntzer anntzer deleted the notify_axes_change branch April 4, 2018 18:27
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.

5 participants