{ bool drawMultiGraphs = false; Int_t rangeFunc = 1; // 1 - SetLimits, 2 - SetRange, 3 - SetUserRange const Int_t N1 = 10; const Int_t N2 = 6; Int_t NMax, in; Float_t x1[N1], x2[N2], y1[N1], y2[N2], step, dir; y1[0] = 5.0; y2[0] = 0.1; step = 0.5; x1[0] = 0.0; x2[0] = 1.5; dir = 1.0; cout<<"Graph1:\n"; for (in=1; inN1/2) dir = -1.0; x1[in] = (Float_t) in; y1[in] = y1[in-1]+(2.0*step*dir); cout<<"("<GetHistogram(); h1->Scale(0.1); h1->SetXTitle("X title"); h1->SetYTitle("Y title"); TCanvas *c1 = new TCanvas("c1", "Intensity of LED 1",0, 0, 800, 600); TPad *pad1 = new TPad("pad1","",0,0,1,1); TPad *pad2 = new TPad("pad2","",0,0,1,1); pad2->SetFillStyle(4000); // Makes pad2 pad2->SetFrameFillStyle(0); // transparent. pad1->Draw(); pad1->cd(); inputSpec->SetMarkerStyle(29); inputSpec->SetMarkerColor(kBlack+2); inputSpec->SetLineColor(kBlack); mg->Add(inputSpec,"LP"); if (drawMultiGraphs) { mg->Draw("ALP"); // mg->GetXaxis()->SetLimits(0.,9.); switch (rangeFunc) { case 1: mg->GetXaxis()->SetLimits(0.,9.); break; case 2: mg->GetXaxis()->SetRange(0.,9.); break; case 3: mg->GetXaxis()->SetRangeUser(0.,9.); break; } mg->GetXaxis()->SetRangeUser(0.,9.); pad1->Update(); } else { // inputSpec->GetXaxis()->SetLimits(0.,9.); switch (rangeFunc) { case 1: inputSpec->GetXaxis()->SetLimits(0.,9.); break; case 2: inputSpec->GetXaxis()->SetRange(0.,9.); break; case 3: inputSpec->GetXaxis()->SetRangeUser(0.,9.); break; } inputSpec->Draw("ALP"); } TH1F *h2 = inputSpec2->GetHistogram(); TAxis *Ay2 = h2->GetYaxis(); Ay2->SetRangeUser(0.0, 0.5); pad2->Draw(); pad2->cd(); inputSpec2->SetMarkerStyle(29); inputSpec2->SetMarkerColor(kRed+2); inputSpec2->SetLineColor(kRed); mg2->Add(inputSpec2,"LPY+"); if (drawMultiGraphs) { mg2->Draw("LPAY+"); switch (rangeFunc) { case 1: mg2->GetXaxis()->SetLimits(0.,9.); break; case 2: mg2->GetXaxis()->SetRange(0.,9.); break; case 3: mg2->GetXaxis()->SetRangeUser(0.,9.); break; } mg2->GetXaxis()->SetAxisColor(kRed); mg2->GetXaxis()->SetLabelColor(kRed); mg2->GetYaxis()->SetAxisColor(kRed); mg2->GetYaxis()->SetLabelColor(kRed); pad2->Update(); } else { switch (rangeFunc) { case 1: inputSpec2->GetXaxis()->SetLimits(0.,9.); break; case 2: inputSpec2->GetXaxis()->SetRange(0.,9.); break; case 3: inputSpec2->GetXaxis()->SetRangeUser(0.,9.); break; } inputSpec2->GetXaxis()->SetAxisColor(kRed); inputSpec2->GetXaxis()->SetLabelColor(kRed); inputSpec2->GetYaxis()->SetAxisColor(kRed); inputSpec2->GetYaxis()->SetLabelColor(kRed); inputSpec2->Draw("LPAY+"); } }