tbn
1
Dear Rooters,
The attached script produces a TGraphErrors which starts right at 0. Unfortunately, the code
gr->GetXaxis()->SetRangeUser(-1.,10.);
does not work on the lower bounds below zero.
Nevertheless, this would be important to display the features of the TGraphs I have to produce.
Could anybody give me some advice?
Thanks a lot,
Tobias
graph_axis.cxx (542 Bytes)
brun
2
I suggest the following:
Rene
[code]void graph_axis(){
c1 = new TCanvas(“c1”,“A Simple Graph with error bars”,200,10,700,500);
c1->SetGrid();
c1->GetFrame()->SetBorderSize(12);
TH1 *frame = c1->DrawFrame(-1,0,10,11);
const Int_t n = 10;
Double_t x[n] = {0.,1.,2.,3.,4.,5.,6.,7.,8.,9.};
Double_t y[n] = {1,2.9,5.6,7.4,9,9.6,8.7,6.3,4.5,1};
Double_t ey[n] = {.8,.7,.6,.5,.4,.4,.5,.6,.7,.8};
gr = new TGraphErrors(n,x,y,NULL,ey);
gr->SetTitle(“TGraphErrors Example”);
gr->SetMarkerColor(4);
gr->SetMarkerStyle(21);
gr->Draw(“LP”);
return;
}
[/code]