Hi Michael,
Your solution has actually a side effect that may or may not be desired.
myTree->Draw("var1:var2",cut);
will draw on the screen every single real data point in its exact location.
myTree->Draw("var1:var2>>histo",cut);
will first bunch the data point in the appropriate bin, losing some
precision
(i.e. instead of knowing a value is exactly 3.2, it will only know it is
between 3 and 4). The histogram will then be drawn using only the binned
information (and point will be put in more or random position within each
bin
limits)
Cheers,
Philippe.
-----Original Message-----
From: Michael Wiesmann [mailto:wiesmann@e18.physik.tu-muenchen.de]
Sent: Wednesday, July 30, 2003 3:17 AM
To: Philippe Canal
Cc: Stilianos Kesisoglou; roottalk@pcroot.cern.ch
Subject: RE: [ROOT] marker when a tree is drawn
Hi!
I think the easiest solution is to define the histo with the draw
command. Two options:
1. myTree->Draw("var1:var2>>histo",cut);
makes a new histogramm with the name "histo". afaik then one can
modify histo
2. myTree->Draw("var1:var2>>histo2(100,0,1,100,0,1)",cut);
makes a 2d histogram with 100 bins x, 100 bins y
Greets
Michael
Philippe Canal writes:
> Hi,
>
> When doing: myTree->Draw("var1:var2",cut);
> rather than drawing an histogram, ALL the data is drawn using a
TPolyMarker.
>
> The simpliest solution is to set a default marker for the tree:
> myTree->SetMarkerStyle(3);
> myTree->Draw("var1:var2",cut);
> Or after the fact you can do
> myTree->Draw("var1:var2",cut);
> p = dynamic_cast<TPolyMaker*>(
> gPad->GetListOfPrimitives()->FindObject("TPolyMaker") );
> if (p) p->SetMarketStyle(3);
>
> Cheers,
> Philippe.
>
> -----Original Message-----
> From: owner-roottalk@pcroot.cern.ch
[mailto:owner-roottalk@pcroot.cern.ch]On
> Behalf Of Stilianos Kesisoglou
> Sent: Tuesday, July 29, 2003 3:13 PM
> To: roottalk@pcroot.cern.ch
> Subject: [ROOT] marker when a tree is drawn
>
>
> Hi,
>
> I am having a problem to set the marker size and style when I draw
> directly from a tree:
>
> myTree->Draw("var1:var2",cut);
>
> If I try to set the marker attributes for the histogram "htemp" there
is
> no effect. The same happens
> if I try to do it interactively with the mouse.
>
> When I first book a TH2F histogram (named "histo") and then I do:
>
> myTree->Draw("var1:var2>>histo",cut);
>
> then I can set the marker attributes for the histogram "histo".
>
> Any way to do it directly on the first case without booking a
histogram?
>
> Thanks!
>
> Stelios.
>
>
> #################################################################
> #################################################################
> #################################################################
> #####
> #####
> #####
> #################################################################
> #################################################################
> #################################################################
This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:14 MET