8000 Clarify that set_axisbelow doesn't move grids below images. · matplotlib/matplotlib@f1aa13a · GitHub
[go: up one dir, main page]

Skip to content

Commit f1aa13a

Browse files
committed
Clarify that set_axisbelow doesn't move grids below images.
Even axisbelow(True) sets the grid zorder to 0.5, which is still over images (zorder 0). One may want to have grids *below* images if the image's extent doesn't cover the whole axes limits (e.g. the image only occupies the top left corner of the Axes and one wants to draw gridlines on the rest but keep them below the image otherwise).
1 parent d48b2a8 commit f1aa13a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/matplotlib/axes/_base.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3157,13 +3157,18 @@ def set_axisbelow(self, b):
31573157
b : bool or 'line'
31583158
Possible values:
31593159
3160-
- *True* (zorder = 0.5): Ticks and gridlines are below all Artists.
3160+
- *True* (zorder = 0.5): Ticks and gridlines are below patches and
3161+
lines, though still above images.
31613162
- 'line' (zorder = 1.5): Ticks and gridlines are above patches
31623163
(e.g. rectangles, with default zorder = 1) but still below lines
31633164
and markers (with their default zorder = 2).
31643165
- *False* (zorder = 2.5): Ticks and gridlines are above patches
31653166
and lines / markers.
31663167
3168+
Notes
3169+
-----
3170+
For more control, call the `~.Artist.set_zorder` method of each axis.
3171+
31673172
See Also
31683173
--------
31693174
get_axisbelow

0 commit comments

Comments
 (0)
0