Jonathan,
see documentation of TTree::Draw
http://root.cern.ch/root/htmldoc/TTree.html#TTree:Draw
it says:
varexp is an expression of the general form
- "e1" produces a 1-d histogram of expression "e1"
- "e1:e2" produces a 2-d histogram (or profile) of "e1" versus
"e2"
- "e1:e2:e3" produces a 3-d scatter-plot of "e1" versus "e2"
versus "e3"
- "e1:e2:e3:e4" produces a 3-d scatter-plot of "e1" versus "e2"
versus "e3"
and "e4" mapped on the color number.
Rene Brun
On Mon, 20
Oct 2003,
Johnathan Wang wrote:
> Hi, I've the following piece of code which draws an ntuple under a
> condition. However, if one looks at the plot, one would notice that it's
> the z variable, not the x variable, that's constrained according to the
> cut. Is this a bug? If so, would you fix it?
> Thank you so much
> john
>
> {
> gROOT->Reset();
>
> TCanvas *canvas = new TCanvas("canvas","foo",200,10,700,780);
> TNtuple *ntuple = new TNtuple("ntuple", "data from ascii file",
> "x:y:z:v");
> ntuple->ReadFile ("foo");
>
> ntuple->Draw ("x:y:z:v", "x < .1 && x > -.1");
>
> TH1F *htemp = (TH1F*)gPad->GetPrimitive("htemp");
> htemp->SetXTitle("x");
> htemp->SetYTitle("y");
> htemp->SetZTitle("z");
> }
>
This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:16 MET