Hi Marco,
Marco van Leeuwen wrote:
>
> Hi all,
>
> TNtuples are really a nice way to have an interactive look at your data.
> However, I have the following related questions:
>
> 1) If a draw a two-dimensional plot from an TNtuple, using:
> MyNtuple.Draw("x:y"); , you always get a two-dimensional histogram. This
> means that the points which are drawn are not the original (x,y) points,
> but a representation of the point density. Is the a way to obtain something
> like a TGraph from an NTuple ??
By default you get a scatter plot where the points drawn ARE the
original
points. However, if you have the command:
MyNtuple.draw("x:y>>myHist")
a TH2F histogram is created with a default of 40x40 bins.
if you redraw this TH2F, points are then randomized in each cell.
If you look carefully at the documentation of TTree::Draw (see URL:
http://root.cern.ch/root/html/TTree.html#TTree:Draw
look at the section: "How to obtain more info from TTree::Draw"
You will see an example how to build a TGraph following a TTree::Draw.
>
> 2) How can you cange the color of the plotted points? I tried
> gStyle->SetHistColor(); and gStyle->SetLineColor(); but this doesn't work.
> In the source code of TH1::PaintScatterPlot(), I didn't find any
> color-setting...
The objects created by a TTree::Draw inherit theit attributes from the
TTree object itself.
you can do; MyNtuple->SetMarkerColor(kRed), the generated scatter plot
will then use red dots.
>
> 3) The advantage of using TGraphs, would be that one can also use different
> marker/line styles to distinguish graph. However, I found that it is
> impossible to draw two graphs on top of each other; I think the "same"
> option is not mentioned in the TGraph::Paint.... routines. Is this correct??
There is no "same" options for TGraphs. See tutorials illiustrating
TGraph or TGraphErrors in $ROOTSYS/tutorials/graph.C, gerrors2.C
Rene Brun
This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:37 MET