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

Skip to content

Add deprecation for Axes.set_thetagrids(frac). #9796

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
Nov 20, 2017

Conversation

QuLogic
Copy link
Member

@QuLogic QuLogic commented Nov 16, 2017

PR Summary

Using frac is no longer possible, but replaced by setting the padding on the ticks. Unfortunately, it is not straightforward to simply restore the behaviour of this parameter within the bounds of the current implementation, since padding is now radius-independent. I think it could be done with a bit of work, but I'm not sure it'd be worth it.

Closes #9744.

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

@QuLogic QuLogic added this to the v2.1.1 milestone Nov 16, 2017
@@ -1173,6 +1173,11 @@ def set_thetagrids(self, angles, labels=None, frac=None, fmt=None,

ACCEPTS: sequence of floats
"""
if frac is not None:
cbook.warn_deprecated('2.1', name='frac', obj_type='parameter',
Copy link
Member

Choose a reason for hiding this comment

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

Can this be 2.2 (or maybe 2.1.1), since 2.1 has already been released?

Copy link
Member Author

Choose a reason for hiding this comment

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

I put 2.1 because it technically stopped working in that version. Not sure how much effort is worth it to re-enable the functionality.

@tacaswell
Copy link
Member

Can you also add a note to the whats_new or api_changes that went along with the polar update?

Copy link
Contributor

@dopplershift dopplershift left a comment

Choose a reason for hiding this comment

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

Strange to raise a deprecation warning for something that's just outright no longer there, but I don't see a better way.

@dopplershift dopplershift merged commit 7b0c82a into matplotlib:v2.1.x Nov 20, 2017
@QuLogic QuLogic deleted the polar-frac branch November 20, 2017 22:00
@pmcculey
Copy link

pmcculey commented Dec 8, 2017

Are there any examples of how to implement this functionality by setting the padding on the ticks? All my polar plots used frac to put the theta labels inside the plot.

@pmcculey
Copy link

pmcculey commented Dec 8, 2017

Never mind, got it. ax.tick_params( 'x', pad = -15 ) works for the theta axis.

I can't follow it with a similar call for the y axis though such as ax.tick_params( 'y', pad = -15 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants