Hi,
Could anyone help me to set Y-axis range for two upper graph and
another rang for two bottom graph ?
Suppose My Script is as followes.
void MChar()
{
TCanvas *c1 = new TCanvas("c1","",200,10,900,700);
// c1->SetFillColor(0);
// gStyle->SetOptStat(0);
c1->Divide(2,2,0,0);
const Int_t n1 = 8;
Double_t y1[] = {1.559,1.38,0.847,0.4337,0.219,0.090,0.0451,0.0297};
Double_t x1[] = {356.1,304,237.1,167,113.8,74.0,45.7,26.3};
TGraphErrors *gr1 = new TGraphErrors(n1,x1,y1);
gPad->SetTickx(2);
gr1->SetMarkerColor(1);
gr1->SetMarkerStyle(20);
gr1->SetMarkerSize(1);
c1->cd(1);
gr1->Draw("AP");
const Int_t n2 = 8;
Double_t y2[] = {3.27,4.51,6.13,8.13,10.45,13.2,16.7,19.5 };
Double_t x2[] = {26.3,45.7,74.0,113.8,167,237.1,304,356.1} ;
TGraphErrors *gr2 = new TGraphErrors(n2,x2,y2);
gPad->SetTickx(2);
gPad->SetTicky(2);
gr2->SetMarkerColor(4);
gr2->SetMarkerStyle(21);
gr2->SetMarkerSize(2);
c1->cd(2);
gr2->Draw("AP");
const Int_t n3 = 8;
Double_t y3[] = {0.0339,-0.009,0.001,-0.02,0.02,0.01,0.0003,-0.004 };
Double_t x3[] ={26.3,45.7,74.0,113.8,167,237.1,304,356.1 };
TGraphErrors *gr3 = new TGraphErrors(n3,x3,y3);
gr3->SetMarkerColor(4);
gr3->SetMarkerStyle(22);
gr3->SetMarkerSize(2);
c1->cd(3);
gr3->Draw("AP");
const Int_t n4 = 8;
Double_t y4[] = {0.436,0.28,0.202,0.17,0.10,0.04,0.046,0.038,0.036 };
Double_t x4[] ={ 26.3,45.7,74.0,113.8,167,237.1,304,356.1 } ;
TGraphErrors *gr4 = new TGraphErrors(n4,x4,y4);
gPad->SetTicky(2);
gr4->SetMarkerColor(6);
gr4->SetMarkerStyle(29);
gr4->SetMarkerSize(2);
c1->cd(4);
gr4->Draw("AP");
}
regards,