Dear ROOTers I put four TGraphs in a TH2 and fitted them. Now I'd like to label the four curves. I tried it with TPaveText, but the problem is, that in my case TPavetext.Draw() works in an empty canvas only. Where is the mistake? You can see my code below. Thank you Christian -- c1 = new TCanvas("c1","Resolution",200,10,700,500); c1->SetFillColor(42); c1->SetGrid(); c1->GetFrame()->SetFillColor(21); c1->GetFrame()->SetBorderSize(12); TH2F *hr = new TH2F("hr","Resolution of the Strip Modules for electrons",40,5,60,40,4,13); hr->SetXTitle("Lead Thickness [mm]"); hr->SetYTitle("Resolution (RMS) [mm]"); hr->Draw(); TGraph *gr[4]; for (i=0;i<4;i++) { gr[i] = new TGraph(n,lead,resol[i]); gr[i]->SetTitle("Resolution"); gr[i]->SetMarkerColor(i+1); gr[i]->SetMarkerStyle(21+i); gr[i]->Draw("P"); gr[i]->Fit("pol3"); } TPaveText pt1(0.7,0.8,0.9,0.9); pt1.AddText("1 GeV"); pt1.Draw(); -- ___________________________________________________________________ Christian Haeberli christian.haeberli@cern.ch University of Bern Laboratory for High Energy Physics Phone : ++ 41 31 631 4069 Sidlerstr. 5 Mobile: ++ 41 76 316 6159 CH-3012 BERN Fax : ++ 41 31 631 4487
This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:29 MET