This shows you the differences between two versions of the page.
Last revisionBoth sides next revision | |||
root:colorscheme [2010/05/05 14:16] – created decianm | root:colorscheme [2010/08/24 16:58] – abuechle | ||
---|---|---|---|
Line 12: | Line 12: | ||
TColor:: | TColor:: | ||
gStyle-> | gStyle-> | ||
+ | </ | ||
+ | |||
+ | |||
+ | and for python: | ||
+ | < | ||
+ | def set_palette(name=" | ||
+ | """ | ||
+ | stops, red, green and blue should all be lists of the same length | ||
+ | see set_decent_colors for an example""" | ||
+ | |||
+ | if name == " | ||
+ | stops = [0.00, 0.34, 0.61, 0.84, 1.00] | ||
+ | red = [1.00, 0.84, 0.61, 0.34, 0.00] | ||
+ | green = [1.00, 0.84, 0.61, 0.34, 0.00] | ||
+ | blue = [1.00, 0.84, 0.61, 0.34, 0.00] | ||
+ | # elif name == " | ||
+ | # (define more palettes) | ||
+ | else: | ||
+ | # default palette, looks cool | ||
+ | stops = [0.00, 0.34, 0.61, 0.84, 1.00] | ||
+ | red = [0.00, 0.00, 0.87, 1.00, 0.51] | ||
+ | green = [0.00, 0.81, 1.00, 0.20, 0.00] | ||
+ | blue = [0.51, 1.00, 0.12, 0.00, 0.00] | ||
+ | |||
+ | s = array(' | ||
+ | r = array(' | ||
+ | g = array(' | ||
+ | b = array(' | ||
+ | |||
+ | npoints = len(s) | ||
+ | TColor.CreateGradientColorTable(npoints, | ||
+ | gStyle.SetNumberContours(ncontours) | ||
</ | </ |