Re: PAW: null, ROOT:?

Rene Brun (Rene.Brun@cern.ch)
Thu, 24 Jul 1997 19:35:29 +0200


Janousch Markus wrote:
>
> Hi,
>
> what is the equivalent command of the PAW-command null, i.e. how do I
> get a frame with specific ranges in x and y? To be more, specific I'd
> like to have the following equivalent in ROOT
>
> PAW> null 0 80 0.15 0.18
> PAW> graph 151 eps c1 c
> PAW> igset pmci 2
> PAW> hplot/symbol others...
>
> The automatic calculation with a TGraph does not help because I'd like
> to have several graphs with slightly different ranges in the same pad.

Here is an example (the tutorials/graph.C example) slightly
modified to do the job.

Rene Brun

{
gROOT->Reset();
c1 = new TCanvas("c1","A Simple Graph Example",200,10,700,500);
c1->SetGridx();
c1->SetGridy();

// Draw frame using a 2-d dummy histogram
hframe = new TH2F("hframe","A Simple Graph
Example",2,-0.4,2.4,2,-3,14);
hframe->SetXTitle("X title");
hframe->SetYTitle("Y title");
hframe->Draw();

Int_t n = 20;
Float_t x[n], y[n];
for (Int_t i=0;i<n;i++) {
x[i] = i*0.1;
y[i] = 10*sin(x[i]+0.2);
}
gr = new TGraph(n,x,y);
gr->SetFillColor(19);
gr->SetLineColor(2);
gr->SetLineWidth(4);
gr->SetMarkerColor(4);
gr->SetMarkerStyle(21);
gr->Draw("CP");

}