{ //(1-he)/6 // gStyle->SetNdivisions(210,"X"); // gStyle->SetNdivisions(210,"Y"); // gStyle->SetLabelSize(0.06,"X"); // gStyle->SetLabelSize(0.06,"Y"); // gStyle->SetTitleSize(0.06,"X"); // gStyle->SetTitleSize(0.06,"Y"); // gStyle->SetTitleOffset(1.25,"Y"); gStyle->SetPadBorderSize(0); gStyle->SetLineWidth(2); gStyle->SetPadBottomMargin(0); gStyle->SetPadTopMargin(0); gStyle->SetPadLeftMargin(.15); gStyle->SetPadRightMargin(0.05); gStyle->SetTitleFillColor(10); double bmargin=.1; double lmargin=0;//.1; TCanvas *can = new TCanvas("help","help"); TPad *innerpad = new TPad("innerpad","innerpad",0.13,0,1,.95); innerpad->Draw(); Int_t divy=6; Int_t divx=3; double dy = (1.-bmargin)/divy; double dx = (1.-lmargin)/divx; Int_t dists[]={983,978,973,968,960,950}; TH1F *h; for(int i=0; i<6; i++){ for(int ring=1; ring<=3; ring++){ TString histname = Form("ring%irow%i",ring,dists[i]); h = new TH1F(histname,histname,2048,-0.5,2047.5); for(int j=0; j<600; j++) h->Fill(gRandom->Gaus(610,2)); } } TString sdists[]={"Row 1","Row 2","Row 3", "Row 4","Row 5","Row 6"}; for(int i=0; iSetBottomMargin(bmargin/(1-dy*(divy-1))); // if(i%divx!=0) pad->SetLeftMargin(0); else // pad->SetLeftMargin(lmargin/(1-dx*(divx-1))); innerpad->cd(); pad->Draw(); pad->cd(); TString histname = Form("ring%irow%i",i%divx+1,dists[i/divx]); std::cout << histname << "\n"; h = (TH1F*)(gROOT->Get(histname)); h->SetStats(0); h->SetTitle(); h->SetMinimum(0); // h->SetMaximum(99); if(i%divx>0) h->GetXaxis()->SetRangeUser(590,620); else h->GetXaxis()->SetRangeUser(600,630); h->GetYaxis()->SetLabelSize(.3); if(i/divx==divy-1) { h->GetYaxis()->SetLabelSize(.3*dy/(dy+bmargin)); h->GetXaxis()->SetLabelSize(.3*dy/(dy+bmargin)); h->GetXaxis()->SetLabelOffset(0.06); h->GetXaxis()->SetTitleSize(.3*dy/(dy+bmargin)); h->GetXaxis()->SetTitle("#gamma-ray energy [keV]"); h->GetXaxis()->CenterTitle(); } h->GetYaxis()->SetNdivisions(2,false); // h->GetYaxis()->SetDecimals(0); h->SetLineColor(1); h->Draw("h"); } can->cd(); for(int i=0; i<6; i++){ double px1=0.02,py1=0.95-.95/(6+bmargin/(1-dy*(divy-1)))*(i+0.5); TLatex *l1 = new TLatex(px1,py1,sdists[i]); l1->SetName(Form("latex%i",i)); l1->SetTextSize(0.04); l1->Draw(); } can->cd(); TLatex *ring1 = new TLatex(.07+.15,0.96,"1"); ring1->SetName("Ring1"); ring1->SetTextSize(0.05); ring1->Draw(); TLatex *ring2 = new TLatex(.07+.45,0.96,"2"); ring2->SetName("Ring2"); ring2->SetTextSize(0.05); ring2->Draw(); TLatex *ring3 = new TLatex(.07+.75,0.96,"3"); ring3->SetName("Ring3"); ring3->SetTextSize(0.04); ring3->Draw(); can->cd(); can->Print("help.png"); }