@@ -1544,7 +1544,7 @@ def yticks(ticks=None, labels=None, **kwargs):
1544
1544
return locs , labels
1545
1545
1546
1546
1547
- def rgrids (* args , ** kwargs ):
1547
+ def rgrids (radii = None , labels = None , angle = None , fmt = None , ** kwargs ):
1548
1548
"""
1549
1549
Get or set the radial gridlines on the current polar plot.
1550
1550
@@ -1606,15 +1606,17 @@ def rgrids(*args, **kwargs):
1606
1606
ax = gca ()
1607
1607
if not isinstance (ax , PolarAxes ):
1608
1608
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 :
1610
1610
lines = ax .yaxis .get_gridlines ()
1611
1611
labels = ax .yaxis .get_ticklabels ()
1612
1612
else :
1613
- lines , labels = ax .set_rgrids (* args , ** kwargs )
1613
+ lines , labels = ax .set_rgrids (radii ,
1614
+ labels = labels , angle = angle , fmt = fmt ,
1615
+ ** kwargs )
1614
1616
return lines , labels
1615
1617
1616
1618
1617
- def thetagrids (* args , ** kwargs ):
1619
+ def thetagrids (angles = None , labels = None , fmt = None , ** kwargs ):
1618
1620
"""
1619
1621
Get or set the theta gridlines on the current polar plot.
1620
1622
@@ -1673,11 +1675,12 @@ def thetagrids(*args, **kwargs):
1673
1675
ax = gca ()
1674
1676
if not isinstance (ax , PolarAxes ):
1675
1677
raise RuntimeError ('thetagrids only defined for polar axes' )
1676
- if not args and not kwargs :
1678
+ if all ( param is None for param in [ angles , labels , fmt ]) and not kwargs :
1677
1679
lines = ax .xaxis .get_ticklines ()
1678
1680
labels = ax .xaxis .get_ticklabels ()
1679
1681
else :
1680
- lines , labels = ax .set_thetagrids (* args , ** kwargs )
1682
+ lines , labels = ax .set_thetagrids (angles ,
1683
+ labels = labels , fmt = fmt , ** kwargs )
1681
1684
return lines , labels
1682
1685
1683
1686
0 commit comments