Skip to content

Commit cd33ed2

Browse files
authored
Merge pull request #20013 from anntzer/ps
Move restriction of polar theta scales to ThetaAxis._set_scale.
2 parents ab313fa + 05cbbed commit cd33ed2

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lib/matplotlib/projections/polar.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,9 @@ def cla(self):
389389
self.clear()
390390

391391
def _set_scale(self, value, **kwargs):
392+
if value != 'linear':
393+
raise NotImplementedError(
394+
"The xscale cannot be set on a polar plot")
392395
super()._set_scale(value, **kwargs)
393396
self._wrap_locator_formatter()
394397

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

1394-
def set_xscale(self, scale, *args, **kwargs):
1395-
if scale != 'linear':
1396-
raise NotImplementedError(
1397-
"You can not set the xscale on a polar plot.")
1398-
13991397
def format_coord(self, theta, r):
14001398
# docstring inherited
14011399
if theta < 0:

0 commit comments

Comments
 (0)