16void hist011_TH1_legend_autoplaced()
18 auto *c4 =
new TCanvas(
"c",
"c", 600, 500);
21 auto *hpx =
new TH1D(
"hpx",
"This is the hpx distribution", 100, -4., 4.);
22 hpx->FillRandom(
"gaus", 50000);
24 hpx->GetYaxis()->SetTitle(
"Y Axis title");
25 hpx->GetYaxis()->SetTitleOffset(1.3);
26 hpx->GetYaxis()->CenterTitle(
true);
27 hpx->GetXaxis()->SetTitle(
"X Axis title");
28 hpx->GetXaxis()->CenterTitle(
true);
31 auto *
h1 =
new TH1D(
"h1",
"A green histogram", 100, -2., 2.);
38 g->SetPoint(0, -3.5, 100);
39 g->SetPoint(1, -3.0, 300);
40 g->SetPoint(2, -2.0, 1000);
41 g->SetPoint(3, 1.0, 800);
42 g->SetPoint(4, 0.0, 200);
43 g->SetPoint(5, 3.0, 200);
44 g->SetPoint(6, 3.0, 700);
46 g->SetTitle(
"This is a TGraph");
47 g->SetLineColor(
kRed);
virtual void SetLineColor(Color_t lcolor)
Set the line color.
A TGraph is an object made of two arrays X and Y with npoints each.
1-D histogram with a double per channel (see TH1 documentation)
virtual void FillRandom(TF1 *f1, Int_t ntimes=5000, TRandom *rng=nullptr)
void Draw(Option_t *option="") override
Draw this histogram with options.