Q: TGraphErrors/TGraph options

Pasha Murat (murat@cdfsga.fnal.gov)
Wed, 28 May 1997 23:06:48 GMT


Hi,

if in the following macro (which has been stolen from the ROOT class manual)
I change gr->Draw("AP") into gr->Draw("A") or gr->Draw("P") nothing
happens on the screen except a segment is drawn on the right side of the canvas.
Is it a supposed behaviour?
--------------------------------------------------------------------------------
{
gROOT->Reset();
gStyle->SetFillColor(0);
graph = new TCanvas("graph","A Simple Graph with error bars",200,10,700,500);

Int_t n = 10;
Float_t x[n] = {-0.22, 0.05, 0.25, 0.35, 0.5, 0.61,0.7,0.85,0.89,0.95};
Float_t y[n] = {1,2.9,5.6,7.4,9,9.6,8.7,6.3,4.5,1};
Float_t ex[n] = {.05,.1,.07,.07,.04,.05,.06,.07,.08,.05};
Float_t ey[n] = {.8,.7,.6,.5,.4,.4,.5,.6,.7,.8};

gr = new TGraphErrors(n,x,y,ex,ey);
gr->SetTitle("TGraphErrors Example");
gr->SetMarkerColor(1);
gr->SetMarkerStyle(20);
gr->Draw("AP");
graph->Update();
}
--------------------------------------------------------------------------------
Another relevant question:

I need to superimpose 2 sets of experimental points. To do this in PAW one
uses the following command sequence:

> hplot/null ..... * define dimensions of the plot
> hplot/err .... * plot 1st set of points
> hplot/err .... * plot 2nd set of points

What is the equivalent command sequence of ROOT commands ?
It would be very helpful to include an example of how to do this into ROOT
manual/tutorials - this is one of the very basic things people are doing.

Thanks, Pasha