Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
legend2.C
Go to the documentation of this file.
1 {
2  TCanvas *c2 = new TCanvas("c2","c2",500,300);
3 
4  TLegend* leg = new TLegend(0.2, 0.2, .8, .8);
5  TH1* h = new TH1F("", "", 1, 0, 1);
6 
7  leg->AddEntry(h, "Histogram \"h\"", "l");
8  leg->AddEntry((TObject*)0, "", "");
9  leg->AddEntry((TObject*)0, "Some text", "");
10  leg->AddEntry((TObject*)0, "", "");
11  leg->AddEntry(h, "Histogram \"h\" again", "l");
12 
13  leg->Draw();
14  return c2;
15 }
16