8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3208322 commit 671100fCopy full SHA for 671100f
lib/matplotlib/pyplot.py
@@ -2283,12 +2283,15 @@ def polar(*args, **kwargs):
2283
strings, as in :func:`~matplotlib.pyplot.plot`.
2284
2285
"""
2286
- # If an axis already exists, check if it has a polar projection
+ # If an axes already exists, check if it has a polar projection
2287
if gcf().get_axes():
2288
if not isinstance(gca(), PolarAxes):
2289
warnings.warn('Trying to create polar plot on an axis that does '
2290
'not have a polar projection.')
2291
- ax = gca(polar=True)
+ ax = gca()
2292
+ else:
2293
+ ax = gcf().add_subplot(1, 1, 1, polar=True)
2294
+
2295
ret = ax.plot(*args, **kwargs)
2296
return ret
2297
0 commit comments