'Plot grid lines for this coordinate.
Standard matplotlib appearance options (color, alpha, etc.) can be
passed as keyword arguments.
Parameters
draw_grid : bool
Whether to show the gridlines
grid_type : { \'lines\' | \'contours\' }
Whether to plot the contours by determining the grid lines in
world coordinates and then plotting them in world coordinates
(``\'lines\'``) or by determining the world coordinates at many
positions in the image and then drawing contours
(``\'contours\'``). The first is recommended for 2-d images, while
for 3-d (or higher dimensional) cubes, the ``\'contours\'`` option
is recommended.'

def grid(self, draw_grid=True, grid_type='lines', **kwargs):

    if (grid_type in ('lines', 'contours')):
        self._grid_type = grid_type
    else:
        raise ValueError("grid_type    should    be    'lines'    or    'contours'")
    if ('color' in kwargs):
        kwargs['edgecolor'] = kwargs.pop('color')
    self.grid_lines_kwargs.update(kwargs)
    if self.grid_lines_kwargs['visible']:
        if (not draw_grid):
            self.grid_lines_kwargs['visible'] = False
    else:
        self.grid_lines_kwargs['visible'] = True
