Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 05cbbed

Browse filesBrowse files
committed
Move restriction of polar theta scales to ThetaAxis._set_scale.
This ensures that there's a single place handling the restriction of theta scales, which makes it simpler to follow (otherwise, in ThetaAxis._set_scale, it's not clear what values can be taken by `value`).
1 parent c7ebf91 commit 05cbbed
Copy full SHA for 05cbbed

File tree

Expand file treeCollapse file tree

1 file changed

+3
-5
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-5
lines changed

‎lib/matplotlib/projections/polar.py

Copy file name to clipboardExpand all lines: lib/matplotlib/projections/polar.py
+3-5Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.