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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions doc/users/whats_new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,16 @@ negative values are simply used as labels, and the real radius is shifted by
the configured minimum. This release also allows negative radii to be used for
grids and ticks, which were previously silently ignored.

Radial ticks have been modified to be parallel to the circular grid
line, and angular ticks have been modified to be parallel to the grid
line. It may also be useful to rotate tick *labels* to match the
boundary. Calling ``ax.tick_params(rotation='auto')`` will enable the
new behavior: radial tick labels will be parallel to the circular grid
line, and angular tick labels will be perpendicular to the grid line
(i.e., parallel to the outer boundary).
Radial ticks have been modified to be parallel to the circular grid line, and
angular ticks have been modified to be parallel to the grid line. It may also
be useful to rotate tick *labels* to match the boundary. Calling
``ax.tick_params(rotation='auto')`` will enable the new behavior: radial tick
labels will be parallel to the circular grid line, and angular tick labels will
be perpendicular to the grid line (i.e., parallel to the outer boundary).
Additionally, tick labels now obey the padding settings that previously only
worked on Cartesian plots. Consequently, the ``frac`` argument to
`.PolarAxes.set_thetagrids` is no longer applied. Tick padding can be modified
with the ``pad`` argument to `.Axes.tick_params` or `.Axis.set_tick_params`.


``Figure`` class now has ``subplots`` method
Expand Down
5 changes: 5 additions & 0 deletions lib/matplotlib/projections/polar.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.

alternative='tick padding via '
'Axes.tick_params')

# Make sure we take into account unitized data
angles = self.convert_yunits(angles)
angles = np.asarray(angles, float)
Expand Down