15void legendautoplaced()
17 auto c4 =
new TCanvas(
"c",
"c", 600,500);
18 auto hpx =
new TH1D(
"hpx",
"This is the hpx distribution",100,-4.,4.);
19 hpx->FillRandom(
"gaus", 50000);
21 hpx->GetYaxis()->SetTitle(
"Y Axis title");
22 hpx->GetYaxis()->SetTitleOffset(1.3); hpx->GetYaxis()->CenterTitle(
true);
23 hpx->GetXaxis()->SetTitle(
"X Axis title");
24 hpx->GetXaxis()->CenterTitle(
true);
26 auto h1 =
new TH1D(
"h1",
"A green histogram",100,-2.,2.);
32 g->SetPoint(0, -3.5, 100 );
33 g->SetPoint(1, -3.0, 300 );
34 g->SetPoint(2, -2.0, 1000 );
35 g->SetPoint(3, 1.0, 800 );
36 g->SetPoint(4, 0.0, 200 );
37 g->SetPoint(5, 3.0, 200 );
38 g->SetPoint(6, 3.0, 700 );
40 g->SetTitle(
"This is a TGraph");
41 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(const char *fname, Int_t ntimes=5000, TRandom *rng=nullptr)
Fill histogram following distribution in function fname.
void Draw(Option_t *option="") override
Draw this histogram with options.