Hi Alex, T->Draw("fNvertex:fNtrack>>htemp") generates a scatter plot with the original precision for the coordinates in x and y. htemp->Draw takes the original points (from a TPolyMarker) ,fills a 2-d histogram and draw the cell content gnerating a number of points proportional to the cell content. If you want to get exactly the same result, do T->Draw("fNvertex:fNtrack>>htemp","","hist"); Rene Brun On Wed, 31 Jul 2002, Alexander Dietz wrote: > Hi Rooters, > > I have the following code: > > TCanvas* c1=new TCanvas("c1","c1",10,10,800,600); > TFile f("Event.root"); > T->SetMarkerStyle(7); > > // draw picture 1 > T->Draw("fNvertex:fNtrack>>htemp"); > c1->Print("test1.ps"); > > TH1F* htemp=(TH1F*)gDirectory->Get("htemp"); > htemp->SetTitle("title"); > htemp->Draw(); > htemp->GetXaxis()->SetTitle("title1"); > htemp->GetYaxis()->SetTitle("title2"); > > // draw picture 2 > c1->Print("test2.ps"); > > I create a picture with a tree, give the output into a histogram and draw > the histogram. > While doing that, 'test1.ps' stores the output from the Tree:Draw and > 'test2.ps' stores the output from TH1F:Draw. > When you compare the two pictures you will find that they are completely > different! > > My questions are: > > 1. How to give the output of a Tree:Draw into a histogram to draw exactly > the same picture > > 2. Or how can I set titles to axis when drawing a tree? (There is no > command TTree::GetXaxis() or similar.. > > Cheers > > Alex > >
This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:51:02 MET