@@ -2701,8 +2701,9 @@ def set_axisbelow(self, b):
2701
2701
Possible values:
2702
2702
2703
2703
- *True* (zorder = 0.5): Ticks and gridlines are below all Artists.
2704
- - 'line' (zorder = 1.5): Ticks and gridlines are above patches (
2705
- e.g. rectangles) but still below lines / markers.
2704
+ - 'line' (zorder = 1.5): Ticks and gridlines are above patches
2705
+ (e.g. rectangles, with default zorder = 1) but still below lines
2706
+ and markers (with their default zorder = 2).
2706
2707
- *False* (zorder = 2.5): Ticks and gridlines are above patches
2707
2708
and lines / markers.
2708
2709
@@ -2730,17 +2731,17 @@ def grid(self, b=None, which='major', axis='both', **kwargs):
2730
2731
2731
2732
Parameters
2732
2733
----------
2733
- b : bool or None
2734
+ b : bool or None, optional
2734
2735
Whether to show the grid lines. If any *kwargs* are supplied,
2735
2736
it is assumed you want the grid on and *b* will be set to True.
2736
2737
2737
2738
If *b* is *None* and there are no *kwargs*, this toggles the
2738
2739
visibility of the lines.
2739
2740
2740
- which : {'major', 'minor', 'both'}
2741
+ which : {'major', 'minor', 'both'}, optional
2741
2742
The grid lines to apply the changes on.
2742
2743
2743
- axis : {'both', 'x', 'y'}
2744
+ axis : {'both', 'x', 'y'}, optional
2744
2745
The axis to apply the changes on.
2745
2746
2746
2747
**kwargs : `.Line2D` properties
@@ -2754,7 +2755,11 @@ def grid(self, b=None, which='major', axis='both', **kwargs):
2754
2755
2755
2756
Notes
2756
2757
-----
2757
- The grid will be drawn according to the axes' zorder and not its own.
2758
+ The axis is drawn as a unit, so the effective zorder for drawing the
2759
+ grid is determined by the zorder of each axis, not by the zorder of the
2760
+ `.Line2D` objects comprising the grid. Therefore, to set grid zorder,
2761
+ use `.set_axisbelow` or, for more control, call the
2762
+ `~matplotlib.axis.Axis.set_zorder` method of each axis.
2758
2763
"""
2759
2764
if len (kwargs ):
2760
2765
b = True
0 commit comments