MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / grid

Method grid

lib/matplotlib/axes/_base.py:3444–3484  ·  view source on GitHub ↗

Configure the grid lines. Parameters ---------- visible : bool or None, optional Whether to show the grid lines. If any *kwargs* are supplied, it is assumed you want the grid on and *visible* will be set to True. If *visible* is

(self, visible=None, which='major', axis='both', **kwargs)

Source from the content-addressed store, hash-verified

3442
3443 @_docstring.interpd
3444 def grid(self, visible=None, which='major', axis='both', **kwargs):
3445 """
3446 Configure the grid lines.
3447
3448 Parameters
3449 ----------
3450 visible : bool or None, optional
3451 Whether to show the grid lines. If any *kwargs* are supplied, it
3452 is assumed you want the grid on and *visible* will be set to True.
3453
3454 If *visible* is *None* and there are no *kwargs*, this toggles the
3455 visibility of the lines.
3456
3457 which : {'major', 'minor', 'both'}, optional
3458 The grid lines to apply the changes on.
3459
3460 axis : {'both', 'x', 'y'}, optional
3461 The axis to apply the changes on.
3462
3463 **kwargs : `~matplotlib.lines.Line2D` properties
3464 Define the line properties of the grid, e.g.::
3465
3466 grid(color='r', linestyle='-', linewidth=2)
3467
3468 Valid keyword arguments are:
3469
3470 %(Line2D:kwdoc)s
3471
3472 Notes
3473 -----
3474 The axis is drawn as a unit, so the effective zorder for drawing the
3475 grid is determined by the zorder of each axis, not by the zorder of the
3476 `.Line2D` objects comprising the grid. Therefore, to set grid zorder,
3477 use `.set_axisbelow` or, for more control, call the
3478 `~.Artist.set_zorder` method of each axis.
3479 """
3480 _api.check_in_list(['x', 'y', 'both'], axis=axis)
3481 if axis in ['x', 'both']:
3482 self.xaxis.grid(visible, which=which, **kwargs)
3483 if axis in ['y', 'both']:
3484 self.yaxis.grid(visible, which=which, **kwargs)
3485
3486 def ticklabel_format(self, *, axis='both', style=None, scilimits=None,
3487 useOffset=None, useLocale=None, useMathText=None):

Callers 15

__clearMethod · 0.95
clearMethod · 0.45
clearMethod · 0.45
test_logit_scalesFunction · 0.45
test_quiver_xyFunction · 0.45
test_nanscatterFunction · 0.45
test_aitoff_projFunction · 0.45
test_symlog2Function · 0.45

Calls

no outgoing calls

Tested by 15

test_logit_scalesFunction · 0.36
test_quiver_xyFunction · 0.36
test_nanscatterFunction · 0.36
test_aitoff_projFunction · 0.36
test_symlog2Function · 0.36
test_mollweide_gridFunction · 0.36
test_gridFunction · 0.36