Logo ROOT   6.16/01
Reference Guide
Functions | Variables
legend1.C File Reference

Functions

leg AddEntry ("f1","Function abs(#frac{sin(x)}{x})","l")
 
leg AddEntry ("gr","Graph with error bars","lep")
 
leg AddEntry (h1,"Histogram filled with random numbers","f")
 
gr Draw ("P")
 
f1 Draw ("same")
 
h1 Draw ()
 
h1 FillRandom ("gaus", 30000)
 
 for (Int_t i=0;i< n;i++)
 
h1 SetFillColor (kGreen)
 
h1 SetFillStyle (3003)
 
leg SetHeader ("The Legend Title")
 
f1 SetLineColor (kBlue)
 
gr SetLineColor (kRed)
 
gr SetLineWidth (2)
 
f1 SetLineWidth (4)
 
gr SetMarkerColor (7)
 
gr SetMarkerSize (1.3)
 
gr SetMarkerStyle (21)
 
gr SetName ("gr")
 
gStyle SetOptStat (0)
 

Variables

return c1
 
Double_t ex [n]
 
Double_t ey [n]
 
TF1f1 =new TF1("f1","1000*TMath::Abs(sin(x)/x)",-10,10)
 
TGraphErrorsgr = new TGraphErrors(n,x,y,ex,ey)
 
TH1Fh1 = new TH1F("h1","TLegend Example",200,-10,10)
 
 leg = new TLegend(0.1,0.7,0.48,0.9)
 
const Int_t n = 20
 
Double_t x [n]
 
Double_t y [n]
 

Function Documentation

◆ AddEntry() [1/3]

leg AddEntry ( "f1"  ,
"Function abs(#frac{sin(x)}{x})"  ,
"l"   
)

◆ AddEntry() [2/3]

leg AddEntry ( "gr"  ,
"Graph with error bars ,
"lep"   
)

◆ AddEntry() [3/3]

leg AddEntry ( h1  ,
"Histogram filled with random numbers"  ,
"f"   
)

◆ Draw() [1/3]

gr Draw ( "P"  )

◆ Draw() [2/3]

f1 Draw ( "same"  )

◆ Draw() [3/3]

h1 Draw ( )

◆ FillRandom()

h1 FillRandom ( "gaus"  ,
30000   
)

◆ for()

for ( )

Definition at line 18 of file legend1.C.

◆ SetFillColor()

h1 SetFillColor ( kGreen  )

◆ SetFillStyle()

h1 SetFillStyle ( 3003  )

◆ SetHeader()

leg SetHeader ( "The Legend Title"  )

◆ SetLineColor() [1/2]

f1 SetLineColor ( kBlue  )

◆ SetLineColor() [2/2]

gr SetLineColor ( kRed  )

◆ SetLineWidth() [1/2]

gr SetLineWidth ( )

◆ SetLineWidth() [2/2]

f1 SetLineWidth ( )

◆ SetMarkerColor()

gr SetMarkerColor ( )

◆ SetMarkerSize()

gr SetMarkerSize ( 1.  3)

◆ SetMarkerStyle()

gr SetMarkerStyle ( 21  )

◆ SetName()

gr SetName ( "gr"  )

◆ SetOptStat()

gStyle SetOptStat ( )

Variable Documentation

◆ c1

return c1

Definition at line 41 of file legend1.C.

◆ ex

Double_t ex[n]

Definition at line 17 of file legend1.C.

◆ ey

Double_t ey[n]

Definition at line 17 of file legend1.C.

◆ f1

TF1* f1 =new TF1("f1","1000*TMath::Abs(sin(x)/x)",-10,10)

Definition at line 11 of file legend1.C.

◆ gr

Definition at line 25 of file legend1.C.

◆ h1

TH1F* h1 = new TH1F("h1","TLegend Example",200,-10,10)

Definition at line 5 of file legend1.C.

◆ leg

leg = new TLegend(0.1,0.7,0.48,0.9)

Definition at line 34 of file legend1.C.

◆ n

const Int_t n = 20

Definition at line 16 of file legend1.C.

◆ x

Double_t x[n]

Definition at line 17 of file legend1.C.

◆ y

Double_t y[n]

Definition at line 17 of file legend1.C.