@@ -2716,8 +2716,9 @@ def set_axisbelow(self, b):
2716
2716
Possible values:
2717
2717
2718
2718
- *True* (zorder = 0.5): Ticks and gridlines are below all Artists.
2719
- - 'line' (zorder = 1.5): Ticks and gridlines are above patches (
2720
- e.g. rectangles) but still below lines / markers.
2719
+ - 'line' (zorder = 1.5): Ticks and gridlines are above patches
2720
+ (e.g. rectangles, with default zorder = 1) but still below lines
2721
+ and markers (with their default zorder = 2).
2721
2722
- *False* (zorder = 2.5): Ticks and gridlines are above patches
2722
2723
and lines / markers.
2723
2724
@@ -2745,17 +2746,17 @@ def grid(self, b=None, which='major', axis='both', **kwargs):
2745
2746
2746
2747
Parameters
2747
2748
----------
2748
- b : bool or None
2749
+ b : bool or None, optional
2749
2750
Whether to show the grid lines. If any *kwargs* are supplied,
2750
2751
it is assumed you want the grid on and *b* will be set to True.
2751
2752
2752
2753
If *b* is *None* and there are no *kwargs*, this toggles the
2753
2754
visibility of the lines.
2754
2755
2755
- which : {'major', 'minor', 'both'}
2756
+ which : {'major', 'minor', 'both'}, optional
2756
2757
The grid lines to apply the changes on.
2757
2758
2758
- axis : {'both', 'x', 'y'}
2759
+ axis : {'both', 'x', 'y'}, optional
2759
2760
The axis to apply the changes on.
2760
2761
2761
2762
**kwargs : `.Line2D` properties
@@ -2769,7 +2770,11 @@ def grid(self, b=None, which='major', axis='both', **kwargs):
2769
2770
2770
2771
Notes
2771
2772
-----
2772
- The grid will be drawn according to the axes' zorder and not its own.
2773
+ The axis is drawn as a unit, so the effective zorder for drawing the
2774
+ grid is determined by the zorder of each axis, not by the zorder of the
2775
+ `.Line2D` objects comprising the grid. Therefore, to set grid zorder,
2776
+ use `.set_axisbelow` or, for more control, call the
2777
+ `~matplotlib.axis.Axis.set_zorder` method of each axis.
2773
2778
"""
2774
2779
if len (kwargs ):
2775
2780
b = True
0 commit comments