Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Make plt.{r,theta}grids act as setters even when all args are kwargs. #16988

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
Mar 31, 2020
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
5 changes: 5 additions & 0 deletions doc/api/next_api_changes/behaviour.rst
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,8 @@ support for it will be dropped in a future Matplotlib release.
`.font_manager.json_dump` now locks the font manager dump file
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
... to prevent multiple processes from writing to it at the same time.

`.pyplot.rgrids` and `.pyplot.thetagrids` now act as setters also when called with only kwargs
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Previously, keyword arguments were silently ignored when no positional
arguments were given.
4 changes: 2 additions & 2 deletions lib/matplotlib/pyplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1627,7 +1627,7 @@ def rgrids(*args, **kwargs):
ax = gca()
if not isinstance(ax, PolarAxes):
raise RuntimeError('rgrids only defined for polar axes')
if len(args) == 0:
if not args and not kwargs:
lines = ax.yaxis.get_gridlines()
labels = ax.yaxis.get_ticklabels()
else:
Expand Down Expand Up @@ -1694,7 +1694,7 @@ def thetagrids(*args, **kwargs):
ax = gca()
if not isinstance(ax, PolarAxes):
raise RuntimeError('thetagrids only defined for polar axes')
if len(args) == 0:
if not args and not kwargs:
lines = ax.xaxis.get_ticklines()
labels = ax.xaxis.get_ticklabels()
else:
Expand Down