def get_colormap(name, *args, **kwargs):
 if isinstance(name, BaseColormap):
  cmap = name
 else:
  if (not isinstance(name, string_types)):
   raise TypeError('colormap must be a Colormap or string name')
  if (name not in _colormaps):
   raise KeyError(('colormap name %s not found' % name))
  cmap = _colormaps[name]
  if inspect.isclass(cmap):
   cmap = cmap(*args, **kwargs)
 return cmap

def get_colormap ( name , * args , ** kwargs ) : if isinstance ( name , BaseColormap ) : cmap = name else : if ( not isinstance ( name , string_types ) ) : raise TypeError ( 'colormap must be a Colormap or string name' ) if ( name not in _colormaps ) : raise KeyError ( ( 'colormap name %s not found' % name ) ) cmap = _colormaps [ name ] if inspect . isclass ( cmap ) : cmap = cmap ( * args , ** kwargs ) return cmap
obtain a colormap some colormaps can have additional configuration parameters .