@@ -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,16 @@ 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 (
1614
+ radii , labels = labels , angle = angle , fmt = fmt , ** kwargs )
1614
1615
return lines , labels
1615
1616
1616
1617
1617
- def thetagrids (* args , ** kwargs ):
1618
+ def thetagrids (angles = None , labels = None , fmt = None , ** kwargs ):
1618
1619
"""
1619
1620
Get or set the theta gridlines on the current polar plot.
1620
1621
@@ -1673,11 +1674,12 @@ def thetagrids(*args, **kwargs):
1673
1674
ax = gca ()
1674
1675
if not isinstance (ax , PolarAxes ):
1675
1676
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 :
1677
1678
lines = ax .xaxis .get_ticklines ()
1678
1679
labels = ax .xaxis .get_ticklabels ()
1679
1680
else :
1680
- lines , labels = ax .set_thetagrids (* args , ** kwargs )
1681
+ lines , labels = ax .set_thetagrids (angles ,
1682
+ labels = labels , fmt = fmt , ** kwargs )
1681
1683
return lines , labels
1682
1684
1683
1685
0 commit comments