Skip to content

Commit 439a122

Browse files
authored
Merge pull request matplotlib#16988 from anntzer/rthetagrids
Make plt.{r,theta}grids act as setters even when all args are kwargs.
2 parents 3b41253 + c8ccd84 commit 439a122

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

doc/api/next_api_changes/behaviour.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,3 +150,8 @@ support for it will be dropped in a future Matplotlib release.
150150
`.font_manager.json_dump` now locks the font manager dump file
151151
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
152152
... to prevent multiple processes from writing to it at the same time.
153+
154+
`.pyplot.rgrids` and `.pyplot.thetagrids` now act as setters also when called with only kwargs
155+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
156+
Previously, keyword arguments were silently ignored when no positional
157+
arguments were given.

lib/matplotlib/pyplot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1627,7 +1627,7 @@ def rgrids(*args, **kwargs):
16271627
ax = gca()
16281628
if not isinstance(ax, PolarAxes):
16291629
raise RuntimeError('rgrids only defined for polar axes')
1630-
if len(args) == 0:
1630+
if not args and not kwargs:
16311631
lines = ax.yaxis.get_gridlines()
16321632
labels = ax.yaxis.get_ticklabels()
16331633
else:
@@ -1694,7 +1694,7 @@ def thetagrids(*args, **kwargs):
16941694
ax = gca()
16951695
if not isinstance(ax, PolarAxes):
16961696
raise RuntimeError('thetagrids only defined for polar axes')
1697-
if len(args) == 0:
1697+
if not args and not kwargs:
16981698
lines = ax.xaxis.get_ticklines()
16991699
labels = ax.xaxis.get_ticklabels()
17001700
else:

0 commit comments

Comments
 (0)