Skip to content

Move restriction of polar theta scales to ThetaAxis._set_scale. #20013

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 18, 2021
Merged
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
8 changes: 3 additions & 5 deletions lib/matplotlib/projections/polar.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,9 @@ def cla(self):
self.clear()

def _set_scale(self, value, **kwargs):
if value != 'linear':
raise NotImplementedError(
"The xscale cannot be set on a polar plot")
super()._set_scale(value, **kwargs)
self._wrap_locator_formatter()

Expand Down Expand Up @@ -1391,11 +1394,6 @@ def set_rgrids(self, radii, labels=None, angle=None, fmt=None, **kwargs):
t.update(kwargs)
return self.yaxis.get_gridlines(), self.yaxis.get_ticklabels()

def set_xscale(self, scale, *args, **kwargs):
if scale != 'linear':
raise NotImplementedError(
"You can not set the xscale on a polar plot.")

def format_coord(self, theta, r):
# docstring inherited
if theta < 0:
Expand Down