14void hist026_THStack_color_scheme()
17 auto hs =
new THStack(
"hs",
"Stacked 1D histograms colored using 6-colors scheme");
20 auto h1st =
new TH1F(
"h1st",
"A", 100, -4, 4);
21 h1st->FillRandom(
"gaus", 20000);
25 auto h2st =
new TH1F(
"h2st",
"B", 100, -4, 4);
26 h2st->FillRandom(
"gaus", 15000);
30 auto h3st =
new TH1F(
"h3st",
"C", 100, -4, 4);
31 h3st->FillRandom(
"gaus", 10000);
32 h3st->SetFillColor(
kP6Red);
35 auto h4st =
new TH1F(
"h4st",
"D", 100, -4, 4);
36 h4st->FillRandom(
"gaus", 10000);
40 auto h5st =
new TH1F(
"h5st",
"E", 100, -4, 4);
41 h5st->FillRandom(
"gaus", 10000);
45 auto h6st =
new TH1F(
"h6st",
"F", 100, -4, 4);
46 h6st->FillRandom(
"gaus", 10000);
52 TLegend *
l =
gPad->BuildLegend(.8, .55, 1., .9,
"",
"F");
1-D histogram with a float per channel (see TH1 documentation)
The Histogram stack class.
This class displays a legend box (TPaveText) containing several legend entries.