#NEWLINE# @ staticmethod #NEWLINE# def from_Colormap( map , name = None , gamma = None , **kwargs ) : #NEWLINE# #INDENT# if isinstance ( map , ColorMap ) : #NEWLINE# #INDENT# return map #NEWLINE# #UNINDENT# if isinstance ( map , str ) : #NEWLINE# #INDENT# name = map #NEWLINE# map = get_cmap ( name ) #NEWLINE# #UNINDENT# if isinstance ( map , LinearSegmentedColormap ) : #NEWLINE# #INDENT# segmentdata = map . _segmentdata #NEWLINE# if ( gamma is not None ) : #NEWLINE# #INDENT# gamma = map . _gamma #NEWLINE# #UNINDENT# rgba_bad = map . _rgba_bad #NEWLINE# rgba_under = map . _rgba_under #NEWLINE# rgba_over = map . _rgba_over #NEWLINE# if ( name is not None ) : #NEWLINE# #INDENT# name = map . name #NEWLINE# #UNINDENT# f = ColorMap . from_Colormap_spec ( segmentdata , name = name , gamma = gamma , ** kwargs ) #NEWLINE# if ( rgba_under is not None ) : #NEWLINE# #INDENT# f . set_under ( rgba_under ) #NEWLINE# #UNINDENT# if ( rgba_over is not None ) : #NEWLINE# #INDENT# f . set_over ( rgba_over ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( gamma is None ) : #NEWLINE# #INDENT# gamma = 1.0 #NEWLINE# #UNINDENT# f = ColorMap . from_Colormap_spec ( segmentdata , name = name , gamma = gamma , ** kwargs ) #NEWLINE# #UNINDENT# return f