@@ -2681,30 +2681,35 @@ def set_axisbelow(self, b):
26812681 @docstring .dedent_interpd
26822682 def grid (self , b = None , which = 'major' , axis = 'both' , ** kwargs ):
26832683 """
2684- Turn the axes grids on or off .
2684+ Configure the grid lines .
26852685
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.
26872691
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.
26912694
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 .
26942697
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 .
26972700
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.::
26992703
2700- ax. grid(color='r', linestyle='-', linewidth=2)
2704+ grid(color='r', linestyle='-', linewidth=2)
27012705
2702- Valid :class:`~matplotlib.lines.Line2D` kwargs are
2706+ Valid * kwargs* are
27032707
2704- %(Line2D)s
2708+ %(Line2D)s
27052709
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.
27082713 """
27092714 if len (kwargs ):
27102715 b = True
0 commit comments