plottools.cs.colorscheme.Colorscheme¶
-
class
plottools.cs.colorscheme.Colorscheme(colors, longnames=None, cycle=None, base=None)[source]¶ A colorscheme class useful for plotting
Methods
items()keys()next()get the next color in the cycle plot([ax])plots the current colorscheme main colors reset_index()resets the current color index to 0 set_as_default()sets the colorscheme as the default color cycle in matplotlib figures to_svg(filename)converts the colorscheme to an svg file with block of colors ordered values()-
__init__(colors, longnames=None, cycle=None, base=None)[source]¶ defines a colorscheme object useful for plotting
Parameters: colors : dict
Dictionary of named colors as RGB (0-1) tupples
longnames : dict, optional
Dictionary of long names of the colors specified in colors
cycle : list, optional
List with the cycle order
Examples
>>> cs = Colorscheme({'r':(1.,0.,0.),'g':(0.,1.,0.),'b':(0.,0.,1.)},['b','g','r']) >>> print( cs[0] ) >>> >>> print( cs.next() ) >>> print( cs.next() ) >>> >>> cs.reset_index() >>> print( cs.next() )
Methods
__init__(colors[, longnames, cycle, base])defines a colorscheme object useful for plotting items()keys()next()get the next color in the cycle plot([ax])plots the current colorscheme main colors reset_index()resets the current color index to 0 set_as_default()sets the colorscheme as the default color cycle in matplotlib figures to_svg(filename)converts the colorscheme to an svg file with block of colors ordered values()-