You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Second and subsequent calls to plt.polar() return an Axis object and do not plot #21113
def polar(*args, **kwargs):
"""
Make a polar plot.
call signature::
polar(theta, r, **kwargs)
Multiple *theta*, *r* arguments are supported, with format strings, as in
`plot`.
"""
# If an axis already exists, check if it has a polar projection
if gcf().get_axes():
ax = gca()
if not isinstance(ax, PolarAxes):
_api.warn_external('Trying to create polar plot on an Axes '
'that does not have a polar projection.')
else:
ax = axes(projection="polar")
return ax.plot(*args, **kwargs)
Activity
beckja commentedon Sep 18, 2021
Suggested slightly cleaner version:
def polar(*args, **kwargs):
"""
Make a polar plot.
timhoffm commentedon Sep 18, 2021
Yes. Do you want to make a pull request?
timhoffm commentedon Sep 18, 2021
Note: This is a regression from #19153 introduced into 3.4.0.
beckja commentedon Sep 19, 2021
I'm working the pull request and will submit shortly.
tacaswell commentedon Sep 19, 2021
Thank you @beckja !
QuLogic commentedon Sep 20, 2021
Closed by #21131.