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

Skip to content

Deprecate Locator.autoscale. #13463

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
Jul 23, 2019
Merged

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Feb 18, 2019

Note that this likely indicates that the dates Locators need new
implementations of view_limits, as they appear to never have been
updated to use the "new" (post-2008) API.

per #13292 (comment).

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

@timhoffm
Copy link
Member

timhoffm commented Feb 19, 2019

Both Locator.view_limits() and Axis.get_view_interval() could need some more documentation.

locator.view_limits(*locator.axis.get_view_interval()) looks really obscure to me.

Actually, I have no clear idea what view_limits() is actually doing, which comes part due to a missing verb in the method name (set/get/update/calculate,...) part due to a lack of documentation. Is it a setter/a getter; does it calculate something; does it modify the internal state; what does it return?

@anntzer
Copy link
Contributor Author

anntzer commented Feb 19, 2019

It expands the axes limits when using the old "round numbers" mode (still rcparams-switchable, where the axis would be expanded up to the closest surrounding ticks (so e.g. 1.1..4.1 would get expanded to 0..5) (which is the whole reason the locators have to get involved in the autoscaling) (nowadays the default is to just apply constant margins, of course).

Certainly it could be better documented, though that's not the object of this PR.

@@ -1304,6 +1304,7 @@ def get_unit_generic(freq):
def _get_interval(self):
return self.rule._rrule._interval

@cbook.deprecated("3.1")
Copy link
Member

Choose a reason for hiding this comment

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

Please update all deprecations to 3.2. You'll get an approval as a reward. 😉

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Note that this likely indicates that the dates Locators need new
implementations of view_limits, as they appear to never have been
updated to use the "new" (post-2008) API.
@anntzer anntzer force-pushed the locator-autoscale branch from c8ec566 to 97b9c9a Compare July 23, 2019 07:15
@timhoffm timhoffm merged commit 4a87ab9 into matplotlib:master Jul 23, 2019
@anntzer anntzer deleted the locator-autoscale branch July 23, 2019 21:21
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.

4 participants