{ gROOT->Reset(); const Int_t N = 10; Int_t NMax, in; Float_t x[N], y1[N], y2[N], x1, step, dir; y1[0] = 5.0; y2[0] = 0.1; step = 0.5; x[0] = 0.0; for (in=1; inGetHistogram(); 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); //will be transparent pad1->Draw(); pad1->cd(); // Draw the first graph with axis (A) and Smooth Curve (C) inputSpec->Draw("AC"); gPad->Update(); TH1F *h2 = inputSpec2->GetHistogram(); TAxis *Ay2 = h2->GetYaxis(); Ay2->SetRangeUser(0.0, 0.5); pad2->Draw(); pad2->cd(); inputSpec2->SetLineColor(kRed); // Smooth curve (C) with Marker (P), try AY+ // AY+ clears the previous graph inputSpec2->Draw("CP"); //draw an axis on the right side // Use the size of the pad as the first 4 arguments. // xmin, ymin, xmax, ymax // wmin, wmax, ndiv, chopt // wmin - XOrigin in WC space // wmax - XEnd in WC space // ndiv = N1 + 100*N2 + 10000*N3 // where N1 = number of 1st divisions // N2 = number of second divisions // N3 = number of thrid divisions. // eg in this case 5 third divisions, 1 second and zero first. // // +L - (+) draw tick marks on positive side. // (L) labels are left justified // TGaxis *axis = new TGaxis(gPad->GetUxmax(), gPad->GetUymin(), gPad->GetUxmax(), gPad->GetUymax(), 0,0.5,510,"+L"); axis->SetLineColor(kRed); axis->SetTextColor(kRed); axis->Draw("G"); }