This macro draws all the high definition palettes available in ROOT.
It generates a png file for each palette and one pdf file, with a table of content, containing all the palettes
void draw_palette(
int p,
TString n){
delete c;
c =
new TCanvas(
"c",
"Contours",0,0,500,500);
TF2 *f2 =
new TF2(
"f2",
"0.1+(1-(x-2)*(x-2))*(1-(y-2)*(y-2))",0.999,3.002,0.999,3.002);
TLatex *l =
new TLatex(-0.8704441,0.9779387,
Form(
"Palette #%d: %s #scale[0.7]{(#font[82]{k%s})}",p,n.
Data(),num.
Data()));
if (p==51) {c->
Print(
"palettes.pdf(",
Form(
"Title:%s",n.
Data()));
return;}
if (p==111) {c->
Print(
"palettes.pdf)",
Form(
"Title:%s",n.
Data()));
return;}
}
void palettes() {
c =
new TCanvas(
"c",
"Contours",0,0,500,500);
draw_palette(
kBird,
"Bird");
draw_palette(
kOcean,
"Ocean");
draw_palette(
kArmy,
"Army");
draw_palette(
kBeach,
"Beach");
draw_palette(
kCMYK,
"CMYK");
draw_palette(
kCandy,
"Candy");
draw_palette(
kFall,
"Fall");
draw_palette(
kLake,
"Lake");
draw_palette(
kMint,
"Mint");
draw_palette(
kNeon,
"Neon");
draw_palette(
kPearl,
"Pearl");
draw_palette(
kPlum,
"Plum");
draw_palette(
kRose,
"Rose");
draw_palette(
kRust,
"Rust");
draw_palette(
kSolar,
"Solar");
draw_palette(
kCool,
"Cool");
}
- Author
- Olivier Couet
Definition in file palettes.C.