#NEWLINE# def grid( self , draw_grid = True , grid_type = 'lines' , **kwargs ) : #NEWLINE# #INDENT# "\n        Plot grid lines for this coordinate.\n\n        Standard matplotlib appearance options (color, alpha, etc.) can be\n        passed as keyword arguments.\n\n        Parameters\n        ----------\n        draw_grid : bool\n            Whether to show the gridlines\n        grid_type : { 'lines' | 'contours' }\n            Whether to plot the contours by determining the grid lines in\n            world coordinates and then plotting them in world coordinates\n            (``'lines'``) or by determining the world coordinates at many\n            positions in the image and then drawing contours\n            (``'contours'``). The first is recommended for 2-d images, while\n            for 3-d (or higher dimensional) cubes, the ``'contours'`` option\n            is recommended.\n        " #NEWLINE# if ( grid_type in ( 'lines' , 'contours' ) ) : #NEWLINE# #INDENT# self . _grid_type = grid_type #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise ValueError ( "grid_type should be 'lines' or 'contours'" ) #NEWLINE# #UNINDENT# if ( 'color' in kwargs ) : #NEWLINE# #INDENT# kwargs [ 'edgecolor' ] = kwargs . pop ( 'color' ) #NEWLINE# #UNINDENT# self . grid_lines_kwargs . update ( kwargs ) #NEWLINE# if self . grid_lines_kwargs [ 'visible' ] : #NEWLINE# #INDENT# if ( not grid_type ) : #NEWLINE# #INDENT# self . grid_lines_kwargs [ 'visible' ] = False #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# self . grid_lines_kwargs [ 'visible' ] = True