matplotlib.axis.Axis.grid#

Axis.grid(visible=None,which='major',**kwargs)[source]#

Configure the grid lines.

Parameters:
visiblebool or None

Whether to show the grid lines. If anykwargs are supplied, itis assumed you want the grid on andvisible will be set to True.

Ifvisible isNone and there are nokwargs, this toggles thevisibility of the lines.

which{'major', 'minor', 'both'}

The grid lines to apply the changes on.

**kwargsLine2D properties

Define the line properties of the grid, e.g.:

grid(color='r',linestyle='-',linewidth=2)

Examples usingmatplotlib.axis.Axis.grid#

Log scale

Log scale

Symlog scale

Symlog scale

Boxplots

Boxplots

Box plot vs. violin plot comparison

Box plot vs. violin plot comparison