5 TH1F *
h1 =
new TH1F(
"h1",
"TLegend Example",200,-10,10);
11 TF1 *
f1=
new TF1(
"f1",
"1000*TMath::Abs(sin(x)/x)",-10,10);
20 y[i] = 1000*
sin(x[i]+0.2);
35 leg->SetHeader(
"The Legend Title");
36 leg->AddEntry(h1,
"Histogram filled with random numbers",
"f");
37 leg->AddEntry(
"f1",
"Function abs(#frac{sin(x)}{x})",
"l");
38 leg->AddEntry(
"gr",
"Graph with error bars",
"lep");
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
This class displays a legend box (TPaveText) containing several legend entries.
R__EXTERN TStyle * gStyle
virtual void SetName(const char *name)
Set the name of the TNamed.
THist< 1, float, THistStatContent, THistStatUncertainty > TH1F
1-D histogram with a float per channel (see TH1 documentation)}
virtual void Draw(Option_t *option="")
Draw this function with its current attributes.
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
virtual void Draw(Option_t *chopt="")
Draw this graph with its current attributes.
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual void FillRandom(const char *fname, Int_t ntimes=5000)
Fill histogram following distribution in function fname.
virtual void Draw(Option_t *option="")
Draw this histogram with options.
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
A TGraphErrors is a TGraph with error bars.
void SetOptStat(Int_t stat=1)
The type of information printed in the histogram statistics box can be selected via the parameter mod...