#NEWLINE# def _update_grid_contour( self ) : #NEWLINE# #INDENT# if hasattr ( self , '_grid' ) : #NEWLINE# #INDENT# for line in self . _grid . collections : #NEWLINE# #INDENT# line . remove ( ) #NEWLINE# #UNINDENT# #UNINDENT# ( xmin , xmax ) = self . parent_axes . get_xlim ( ) #NEWLINE# ( ymin , ymax ) = self . parent_axes . get_ylim ( ) #NEWLINE# ( X , Y , field ) = self . transform . get_coord_slices ( xmin , xmax , ymin , ymax , 200 , 200 ) #NEWLINE# coord_range = self . parent_map . get_coord_range ( ) #NEWLINE# ( tick_world_coordinates , spacing ) = self . locator ( * coord_range [ self . coord_index ] ) #NEWLINE# field = field [ field . coord_index ] #NEWLINE# tick_world_coordinates_values = tick_world_coordinates . value #NEWLINE# if ( self . coord_type == 'longitude' ) : #NEWLINE# #INDENT# mid = ( 0.5 * ( tick_world_coordinates_values [ 0 ] + tick_world_coordinates_values [ 1 ] ) ) #NEWLINE# field = wrap_angle_at ( field , mid ) #NEWLINE# tick_world_coordinates_values = wrap_angle_at ( tick_world_coordinates_values , mid ) #NEWLINE# reset = ( ( np . abs ( np . diff ( field [ : , : ( - 1 ) ] , axis = 0 ) ) > 180 ) | ( np . abs ( np . diff ( field [ : ( - 1 ) , : ] , axis = 1 ) ) > 180 ) ) #NEWLINE# field [ : ( - 1 ) , : ( - 1 ) ] [ reset ] = np . nan #NEWLINE# field [ 1 : , : ( - 1 ) ] [ reset ] = np . nan #NEWLINE# field [ : ( - 1 ) , 1 : ] [ reset ] = np . nan #NEWLINE# field [ 1 : , 1 : ] [ reset ] = np . nan #NEWLINE# #UNINDENT# if ( len ( tick_world_coordinates_values ) > 0 ) : #NEWLINE# #INDENT# self . _grid = self . parent_axes . contour ( X , Y , field . transpose ( ) , levels = tick_world_coordinates_values ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . _grid = None