16void hist029_TRatioPlot_simple()
19 auto C =
new TCanvas(
"C",
"A ratio example");
20 auto h1 =
new TH1D(
"h1",
"TRatioPlot Example; x; y", 50, 0, 10);
21 auto h2 =
new TH1D(
"h2",
"h2", 50, 0, 10);
22 auto f1 =
new TF1(
"f1",
"exp(- x/[0] )");
23 f1->SetParameter(0, 3);
24 h1->FillRandom(
"f1", 1900);
25 h2->FillRandom(
"f1", 2000);
28 h2->SetLineColor(
kRed);
34 rp->GetLowYaxis()->SetNdivisions(505);
37 rp->GetUpperPad()->cd();
39 legend->
AddEntry(
"h1",
"First histogram",
"l");
40 legend->
AddEntry(
"h2",
"Second histogram",
"le");
1-D histogram with a double per channel (see TH1 documentation)
TLegendEntry * AddEntry(const TObject *obj, const char *label="", Option_t *option="lpf")
void Draw(Option_t *option="") override
Draw this box with its current attributes.
constexpr Double_t C()
Velocity of light in .