matplotlib.axes.Axes.set_axisbelow#

Axes.set_axisbelow(b)[source]#

Set whether axis ticks and gridlines are above or below most artists.

This controls the zorder of the ticks and gridlines. For moreinformation on the zorder seeZorder Demo.

Parameters:
bbool or 'line'

Possible values:

  • True (zorder = 0.5): Ticks and gridlines are below patches andlines, though still above images.

  • 'line' (zorder = 1.5): Ticks and gridlines are above patches(e.g. rectangles, with default zorder = 1) but still below linesand markers (with their default zorder = 2).

  • False (zorder = 2.5): Ticks and gridlines are above patchesand lines / markers.

Notes

For more control, call theset_zorder method of each axis.