Re: [ROOT] axis of a TTree

From: Rene Brun (Rene.Brun@cern.ch)
Date: Thu Nov 06 2003 - 22:38:08 MET


Hi,

You have two options:

option1: you know the histogram range
=====================================
TH1F *hframe = new TH2F("hframe","a title",40,xmin,xmax,40,ymin,ymax);
hframe->Draw(); //you can set the axis att via hframe->GetXaxis()..
tree->Draw("data1:data2","',"same");

option2: you do not know the histogram range
============================================
//make a first pass to get htemp
tree->Draw("data1:data2");
TH1F *hframe = (TH1F*)htemp->Clone("hframe");
hframe->Draw();
tree->Draw("data1:data2","',"same");

Rene Brun


On 
Thu, 6 Nov 2003 
A.Dietz@mpi-hd.mpg.de wrote:

> Hello Rooters,
> 
> my questions maybe were posted several times before, but I cannot find any
> sufficient answer in the roottalk-forum.
> 
> 
> My question: How can I get the pointer to the x-axis and y-axis when I am
> creating a tree-plot?
> 
> The answer given in most cases is to redirect the draw into a histogram,
> e.g.
> 
>     tree->Draw("data1:data2>>htemp")
> 
> and to use this htemp-histogram. But this is not what I want! In most
> cases this histogram differs significant from a plot created by:
> 
>     tree->Draw("data1:data2")  !!!
> 
> 
> So how can I get the axis from the original tree-plot to set titles, to
> get the xmin and xmax-values and to obtain other informations.
> 
> 
> Thanks a lot in advance,
> Alexander Dietz
> 



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:16 MET