Hi Hucheng, A small example below. See also tutorials graph.C, gerrors.C, gerrors2.C. Rene Brun void sg() { //creation of a TGraph with special range TCanvas *c1 = new TCanvas("c1","simple graph",10,10,800,600); c1->DrawFrame(0,0,10,60); Double_t x[4] = {1,3,5,9}; Double_t y[4] = {48, 49, 52, 50}; TGraph *gr = new TGraph(4,x,y); gr->SetMarkerStyle(21); gr->Draw("lp"); } >Hucheng CHEN wrote: >Hi, Rooters: >I have two arrays, x[] and y[]. I use TGraph to plot y vs x, because the values of >y[] are around 50.0, so the range of Y axis is from 48.0 to 52.0. I hope to change >the range Y axis to show from 0.0 to 60.0, how should I do? I tried >TAxis::SetLimits, but it doesn't work. Anybody can give me some advices? Thanks! >Regards, >Hucheng CHEN
This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:40 MET