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

Skip to content

Commit 703b0e3

Browse files
committed
Document the 'resolution' kwarg to polar plots.
svn path=/branches/v0_98_5_maint/; revision=6854
1 parent 9f78cdc commit 703b0e3

3 files changed

Lines changed: 18 additions & 2 deletions

File tree

CHANGELOG

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2009-01-29 Document 'resolution' kwarg for polar plots. Support it
2+
when using pyplot.polar, not just Figure.add_axes. - MGD
3+
14
2009-01-26 Make curves and NaNs play nice together - MGD
25

36
2009-01-19 Fix bug in quiver argument handling. - EF

lib/matplotlib/projections/polar.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,18 @@ def view_limits(self, vmin, vmax):
182182
def __init__(self, *args, **kwargs):
183183
"""
184184
Create a new Polar Axes for a polar plot.
185+
186+
The following optional kwargs are supported:
187+
188+
- *resolution*: The number of points of interpolation between
189+
each pair of data points. Set to 1 to disable
190+
interpolation.
185191
"""
186192

187193
self._rpad = 0.05
188-
self.resolution = kwargs.pop('resolution', self.RESOLUTION)
194+
self.resolution = kwargs.pop('resolution', None)
195+
if self.resolution is None:
196+
self.resolution = self.RESOLUTION
189197
Axes.__init__(self, *args, **kwargs)
190198
self.set_aspect('equal', adjustable='box', anchor='C')
191199
self.cla()

lib/matplotlib/pyplot.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1406,8 +1406,13 @@ def polar(*args, **kwargs):
14061406
14071407
Make a polar plot. Multiple *theta*, *r* arguments are supported,
14081408
with format strings, as in :func:`~matplotlib.pyplot.plot`.
1409+
1410+
An optional kwarg *resolution* sets the number of vertices to
1411+
interpolate between each pair of points. Set to 1 to disable
1412+
interpolation.
14091413
"""
1410-
ax = gca(polar=True)
1414+
resolution = kwargs.pop('resolution', None)
1415+
ax = gca(polar=True, resolution=resolution)
14111416
ret = ax.plot(*args, **kwargs)
14121417
draw_if_interactive()
14131418
return ret

0 commit comments

Comments
 (0)