Module plottools.grid

Setting grid appearance.

Settings

  • grid_params(): set some default grid parameter via matplotlib's rc settings.

Functions

def grid_params(grid=None, axis=None, which=None, color=None, linestyle=None, linewidth=None, alpha=None)

Set some default grid parameter via matplotlib's rc settings.

Only parameters that are not None are updated.

Call this function before you create any matplotlib figure.

Parameters

grid : bool
Turn grid lines on or off. Sets rcParam axes.grid.
axis : {'both', 'x', 'y'}
For which axis grid lines should be shown. Sets rcParam axes.grid.axis.
which : {'major', 'minor', 'both'}
Grid lines for major, minor or both ticks. Sets rcParam axes.grid.which.
color : matplotlib color
Color of grid lines. Sets rcParam grid.color.
linestyle : string or tuple
Linestyle of grid lines. Sets rcParam grid.linestyle.
lineswidth : float
Width of grid lines in points. Sets rcParam grid.linewidth.
alpha : float
Transparency of grid lines between 0 and 1. Sets rcParam grid.alpha.
def demo()

Run a demonstration of the grid module.