def SVG_path(path, transform=None, simplify=False):
 if (transform is not None):
  path = path.transformed(transform)
 vc_tuples = [((vertices if (path_code != Path.CLOSEPOLY) else []), PATH_DICT[path_code]) for (vertices, path_code) in path.iter_segments(simplify=simplify)]
 if (not vc_tuples):
  return (np.zeros((0, 2)), [])
 else:
  (vertices, codes) = zip(*vc_tuples)
  vertices = np.array(list(itertools.chain(*vertices))).reshape((-1), 2)
  return (vertices, list(codes))

def SVG_path ( path , transform = None , simplify = False ) : if ( transform is not None ) : path = path . transformed ( transform ) vc_tuples = [ ( ( vertices if ( path_code != Path . CLOSEPOLY ) else [ ] ) , PATH_DICT [ path_code ] ) for ( vertices , path_code ) in path . iter_segments ( simplify = simplify ) ] if ( not vc_tuples ) : return ( np . zeros ( ( 0 , 2 ) ) , [ ] ) else : ( vertices , codes ) = zip ( * vc_tuples ) vertices = np . array ( list ( itertools . chain ( * vertices ) ) ) . reshape ( ( - 1 ) , 2 ) return ( vertices , list ( codes ) )
construct the vertices and svg codes for the path parameters path : matplotlib .