17 auto C =
new TCanvas(
"C",
"A ratio example");
18 auto h1 =
new TH1D(
"h1",
"TRatioPlot Example; x; y", 50, 0, 10);
19 auto h2 =
new TH1D(
"h2",
"h2", 50, 0, 10);
20 auto f1 =
new TF1(
"f1",
"exp(- x/[0] )");
21 f1->SetParameter(0, 3);
22 h1->FillRandom(
"f1", 1900);
23 h2->FillRandom(
"f1", 2000);
32 rp->GetLowYaxis()->SetNdivisions(505);
35 rp->GetUpperPad()->cd();
37 legend->
AddEntry(
"h1",
"First histogram",
"l");
38 legend->
AddEntry(
"h2",
"Second histogram",
"le");
R__EXTERN TStyle * gStyle
1-D histogram with a double per channel (see TH1 documentation)
This class displays a legend box (TPaveText) containing several legend entries.
TLegendEntry * AddEntry(const TObject *obj, const char *label="", Option_t *option="lpf")
Add a new entry to this legend.
void Draw(Option_t *option="") override
Draw this legend with its current attributes.
Class for displaying ratios, differences and fit residuals.
constexpr Double_t C()
Velocity of light in .