@@ -1544,7 +1544,7 @@ def yticks(ticks=None, labels=None, **kwargs):
15441544 return locs , labels
15451545
15461546
1547- def rgrids (* args , ** kwargs ):
1547+ def rgrids (radii = None , labels = None , angle = None , fmt = None , ** kwargs ):
15481548 """
15491549 Get or set the radial gridlines on the current polar plot.
15501550
@@ -1606,15 +1606,16 @@ def rgrids(*args, **kwargs):
16061606 ax = gca ()
16071607 if not isinstance (ax , PolarAxes ):
16081608 raise RuntimeError ('rgrids only defined for polar axes' )
1609- if not args and not kwargs :
1609+ if all ( p is None for p in [ radii , labels , angle , fmt ]) and not kwargs :
16101610 lines = ax .yaxis .get_gridlines ()
16111611 labels = ax .yaxis .get_ticklabels ()
16121612 else :
1613- lines , labels = ax .set_rgrids (* args , ** kwargs )
1613+ lines , labels = ax .set_rgrids (
1614+ radii , labels = labels , angle = angle , fmt = fmt , ** kwargs )
16141615 return lines , labels
16151616
16161617
1617- def thetagrids (* args , ** kwargs ):
1618+ def thetagrids (angles = None , labels = None , fmt = None , ** kwargs ):
16181619 """
16191620 Get or set the theta gridlines on the current polar plot.
16201621
@@ -1673,11 +1674,12 @@ def thetagrids(*args, **kwargs):
16731674 ax = gca ()
16741675 if not isinstance (ax , PolarAxes ):
16751676 raise RuntimeError ('thetagrids only defined for polar axes' )
1676- if not args and not kwargs :
1677+ if all ( param is None for param in [ angles , labels , fmt ]) and not kwargs :
16771678 lines = ax .xaxis .get_ticklines ()
16781679 labels = ax .xaxis .get_ticklabels ()
16791680 else :
1680- lines , labels = ax .set_thetagrids (* args , ** kwargs )
1681+ lines , labels = ax .set_thetagrids (angles ,
1682+ labels = labels , fmt = fmt , ** kwargs )
16811683 return lines , labels
16821684
16831685
0 commit comments