Logo ROOT   6.14/05
Reference Guide
Functions | Variables
legend1.C File Reference

Functions

leg AddEntry (h1,"Histogram filled with random numbers","f")
 
leg AddEntry ("f1","Function abs(#frac{sin(x)}{x})","l")
 
leg AddEntry ("gr","Graph with error bars","lep")
 
h1 Draw ()
 
f1 Draw ("same")
 
gr Draw ("P")
 
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)
 
f1 SetLineWidth (4)
 
gr SetLineWidth (2)
 
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 ( h1  ,
"Histogram filled with random numbers"  ,
"f"   
)

◆ AddEntry() [2/3]

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

◆ AddEntry() [3/3]

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

◆ Draw() [1/3]

h1 Draw ( )

◆ Draw() [2/3]

f1 Draw ( "same"  )

◆ Draw() [3/3]

gr Draw ( "P"  )

◆ 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]

f1 SetLineWidth ( )

◆ SetLineWidth() [2/2]

gr 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.