@@ -2681,30 +2681,35 @@ def set_axisbelow(self, b):
2681
2681
@docstring .dedent_interpd
2682
2682
def grid (self , b = None , which = 'major' , axis = 'both' , ** kwargs ):
2683
2683
"""
2684
- Turn the axes grids on or off .
2684
+ Configure the grid lines .
2685
2685
2686
- Set the axes grids on or off; *b* is a boolean.
2686
+ Parameters
2687
+ ----------
2688
+ b : bool or None
2689
+ Whether to show the grid lines. If any *kwargs* are supplied,
2690
+ it is assumed you want the grid on and *b* will be set to True.
2687
2691
2688
- If *b* is *None* and ``len(kwargs)==0``, toggle the grid state. If
2689
- *kwargs* are supplied, it is assumed that you want a grid and *b*
2690
- is thus set to *True*.
2692
+ If *b* is *None* and there are no *kwargs*, this toggles the
2693
+ visibility of the lines.
2691
2694
2692
- * which* can be 'major' (default) , 'minor', or 'both' to control
2693
- whether major tick grids, minor tick grids, or both are affected .
2695
+ which : { 'major', 'minor', 'both'}
2696
+ The grid lines to apply the changes on .
2694
2697
2695
- * axis* can be 'both' (default) , 'x', or 'y' to control which
2696
- set of gridlines are drawn .
2698
+ axis : { 'both', 'x', 'y'}
2699
+ The axis to apply the changes on .
2697
2700
2698
- *kwargs* are used to set the grid line properties, e.g.,::
2701
+ **kwargs : `.Line2D` properties
2702
+ Define the line properties of the grid, e.g.::
2699
2703
2700
- ax. grid(color='r', linestyle='-', linewidth=2)
2704
+ grid(color='r', linestyle='-', linewidth=2)
2701
2705
2702
- Valid :class:`~matplotlib.lines.Line2D` kwargs are
2706
+ Valid * kwargs* are
2703
2707
2704
- %(Line2D)s
2708
+ %(Line2D)s
2705
2709
2706
- Note that the grid will be drawn according to the axes' zorder and not
2707
- its own.
2710
+ Notes
2711
+ -----
2712
+ The grid will be drawn according to the axes' zorder and not its own.
2708
2713
"""
2709
2714
if len (kwargs ):
2710
2715
b = True
0 commit comments