def get_gridline_path(world, pixel):
 mask = (np.isnan(pixel[:, 0]) | np.isnan(pixel[:, 1]))
 codes = np.zeros(world.shape[0], dtype=np.uint8)
 codes[:] = Path.LINETO
 codes[0] = Path.MOVETO
 codes[mask] = Path.MOVETO
 codes[1:][mask[:(-1)]] = Path.MOVETO
 path = Path(pixel, codes=codes)
 return path

def get_gridline_path ( world , pixel ) : mask = ( np . isnan ( pixel [ : , 0 ] ) | np . isnan ( pixel [ : , 1 ] ) ) codes = np . zeros ( world . shape [ 0 ] , dtype = np . uint8 ) codes [ : ] = Path . LINETO codes [ 0 ] = Path . MOVETO codes [ mask ] = Path . MOVETO codes [ 1 : ] [ mask [ : ( - 1 ) ] ] = Path . MOVETO path = Path ( pixel , codes = codes ) return path
draw a grid line parameters lon_lat : ~numpy .