docstr: Toggle the gridlines, and optionally set the properties of the lines.
docstr_tok: ["Toggle","the","gridlines",",","and","optionally","set","the","properties","of","the","lines","."]
code: def grid(self, b=None, which="major", axis="both", **kwargs):
      """
      Toggle the gridlines, and optionally set the properties of the lines.
      """
      # their are some discrepancy between the behavior of grid in
      # axes_grid and the original mpl's grid, because axes_grid
      # explicitly set the visibility of the gridlines.
  
      super(Axes, self).grid(b, which=which, axis=axis, **kwargs)
      if not self._axisline_on:
          return
  
      if b is None:
          if (
              self.axes.xaxis._gridOnMinor
              or self.axes.xaxis._gridOnMajor
              or self.axes.yaxis._gridOnMinor
              or self.axes.yaxis._gridOnMajor
          ):
              b = True
          else:
              b = False
  
      self.gridlines.set_which(which)
      self.gridlines.set_axis(axis)
      self.gridlines.set_visible(b)
  
      if len(kwargs):
          martist.setp(self.gridlines, **kwargs)
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import six
  import warnings
  import numpy
  from matplotlib import rcParams
  import matplotlib.artist
  import matplotlib.axes
  from matplotlib.path import Path
  from matplotlib.transforms import Bbox
  from .axisline_style import AxislineStyle
  from .axis_artist import AxisArtist, GridlinesCollection
label_desc: Use image node_id 10 for calling the Axes obj's underlying member method code with example usage: obj.grid(b, which, axis) without return types