Skip to content

ENH: Add PolarAxes.get_rlim() and get_thetalim() for API symmetry#31695

Open
tinezivic wants to merge 1 commit into
matplotlib:mainfrom
tinezivic:fix/polar-get-rlim-thetalim
Open

ENH: Add PolarAxes.get_rlim() and get_thetalim() for API symmetry#31695
tinezivic wants to merge 1 commit into
matplotlib:mainfrom
tinezivic:fix/polar-get-rlim-thetalim

Conversation

@tinezivic
Copy link
Copy Markdown
Contributor

PR summary

PolarAxes has set_rlim() and set_thetalim() but no corresponding getters.
Added get_rlim() (delegates to get_ylim()) and get_thetalim() (delegates to get_xlim()).

Closes #31694

AI Disclosure

Used GitHub Copilot to understand the existing PolarAxes implementation. The fix and verification are my own.

PR checklist

PR checklist

  • "closes [Bug]: PolarAxes missing get_rlim() and get_thetalim() getters #31694" is in the body of the PR description
  • new and changed code is tested
  • [N/A] Plotting related features are demonstrated in an example — N/A (new getter methods, no visual change)
  • New Features and API Changes are noted with a directive and release note — added doc/release/next_whats_new/polar_get_rlim_thetalim.rst
  • Documentation complies with general and docstring guidelines

@tinezivic tinezivic force-pushed the fix/polar-get-rlim-thetalim branch from 2d28b7f to 384c059 Compare May 17, 2026 19:06
@tinezivic tinezivic force-pushed the fix/polar-get-rlim-thetalim branch from 384c059 to 9d4ca1f Compare May 17, 2026 19:24
Copy link
Copy Markdown
Member

@timhoffm timhoffm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks good except for small wording improvements.

Comment on lines +8 to +10
`~matplotlib.projections.polar.PolarAxes.set_thetalim`. Previously, calling
these getters raised an ``AttributeError``; the workaround was to call the
base-class ``get_ylim()`` / ``get_xlim()`` directly::
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`~matplotlib.projections.polar.PolarAxes.set_thetalim`. Previously, calling
these getters raised an ``AttributeError``; the workaround was to call the
base-class ``get_ylim()`` / ``get_xlim()`` directly::
`~matplotlib.projections.polar.PolarAxes.set_thetalim`. Previously, one
had to use `.Axes.get_ylim`, `.Axes.get_xlim` as a workaround.
::

Attribute error is implied when a method does not exist and is not worth mentioning.

Since you end with the previous behavior, don't :: at the end of it, because that renders
a : at the end of the sentence, which would falsely imply that the following example is related to the sentence.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: PolarAxes missing get_rlim() and get_thetalim() getters

2 participants