Skip to content

Commit 2c5f4b9

Browse files
committed
Merged revisions 7916 via svnmerge from
https://matplotlib.svn.sf.net/svnroot/matplotlib/branches/v0_99_maint ........ r7916 | mdboom | 2009-11-02 13:54:29 -0500 (Mon, 02 Nov 2009) | 2 lines [2890345] pylab.thetagrids() does not accept fmt ........ svn path=/trunk/matplotlib/; revision=7917
1 parent babb082 commit 2c5f4b9

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

lib/matplotlib/projections/polar.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from matplotlib import docstring
1212
from matplotlib.patches import Circle
1313
from matplotlib.path import Path
14-
from matplotlib.ticker import Formatter, Locator
14+
from matplotlib.ticker import Formatter, Locator, FormatStrFormatter
1515
from matplotlib.transforms import Affine2D, Affine2DBase, Bbox, \
1616
BboxTransformTo, IdentityTransform, Transform, TransformWrapper
1717
import matplotlib.spines as mspines
@@ -318,7 +318,7 @@ def set_yscale(self, *args, **kwargs):
318318
set_rticks = Axes.set_yticks
319319

320320
@docstring.dedent_interpd
321-
def set_thetagrids(self, angles, labels=None, frac=None,
321+
def set_thetagrids(self, angles, labels=None, frac=None, fmt=None,
322322
**kwargs):
323323
"""
324324
Set the angles at which to place the theta grids (these
@@ -348,6 +348,8 @@ def set_thetagrids(self, angles, labels=None, frac=None,
348348
self.set_xticks(angles * (npy.pi / 180.0))
349349
if labels is not None:
350350
self.set_xticklabels(labels)
351+
elif fmt is not None:
352+
self.xaxis.set_major_formatter(FormatStrFormatter(fmt))
351353
if frac is not None:
352354
self._theta_label1_position.clear().translate(0.0, frac)
353355
self._theta_label2_position.clear().translate(0.0, 1.0 / frac)
@@ -356,7 +358,8 @@ def set_thetagrids(self, angles, labels=None, frac=None,
356358
return self.xaxis.get_ticklines(), self.xaxis.get_ticklabels()
357359

358360
@docstring.dedent_interpd
359-
def set_rgrids(self, radii, labels=None, angle=None, rpad=None, **kwargs):
361+
def set_rgrids(self, radii, labels=None, angle=None, rpad=None, fmt=None,
362+
**kwargs):
360363
"""
361364
Set the radial locations and labels of the *r* grids.
362365
@@ -389,6 +392,8 @@ def set_rgrids(self, radii, labels=None, angle=None, rpad=None, **kwargs):
389392
self.set_yticks(radii)
390393
if labels is not None:
391394
self.set_yticklabels(labels)
395+
elif fmt is not None:
396+
self.yaxis.set_major_formatter(FormatStrFormatter(fmt))
392397
if angle is None:
393398
angle = self._r_label1_position.to_values()[4]
394399
if rpad is not None:

0 commit comments

Comments
 (0)