docstr: return list of gridline coordinates in data coordinates.
  
  *which* : "major" or "minor"
  *axis* : "both", "x" or "y"
docstr_tok: ["return","list","of","gridline","coordinates","in","data","coordinates",".","*","which","*",":","``","major","''","or","``","minor","''","*","axis","*",":","``","both","''",",","``","x","''","or","``","y","''"]
code: def get_gridlines(self, which="major", axis="both"):
      """
      return list of gridline coordinates in data coordinates.
  
      *which* : "major" or "minor"
      *axis* : "both", "x" or "y"
      """
  
      gridlines = []
  
      if axis in ["both", "x"]:
          locs = []
          y1, y2 = self.axes.get_ylim()
          # if self.axes.xaxis._gridOnMajor:
          if which in ["both", "major"]:
              locs.extend(self.axes.xaxis.major.locator())
          # if self.axes.xaxis._gridOnMinor:
          if which in ["both", "minor"]:
              locs.extend(self.axes.xaxis.minor.locator())
  
          for x in locs:
              gridlines.append([[x, x], [y1, y2]])
  
      if axis in ["both", "y"]:
          x1, x2 = self.axes.get_xlim()
          locs = []
          if self.axes.yaxis._gridOnMajor:
              # if which in ["both", "major"]:
              locs.extend(self.axes.yaxis.major.locator())
          if self.axes.yaxis._gridOnMinor:
              # if which in ["both", "minor"]:
              locs.extend(self.axes.yaxis.minor.locator())
  
          for y in locs:
              gridlines.append([[x1, x2], [y, y]])
  
      return gridlines
  
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 4 for calling the GridHelperRectlinear obj's underlying member method code with example usage: obj.get_gridlines(which, axis) and returns: gridlines