// Author: Hari #include #include "TCanvas.h" #include "TAxis.h" #include "TH1.h" void plotter_stack() { gROOT->Reset(); const Int_t ms_n = 3; TH1 *h1a[ms_n]; TCanvas *c1 = new TCanvas("c1", "", 1000, 700); THStack *hs = new THStack("hs", "hs"); // hs->SetMinimum(0); // <<-------------------------- When i setMinumum, I cant setlogy const char* msarray[ms_n] = {"A1", "A2", "A3"}; for(int i=0;iGetObject("Leading_ELJ_weta2Hist", h1a[i]); if(i == (ms_n-1)) { h1a[1]->SetFillColor(kGreen-6); h1a[2]->SetFillColor(kBlue-7); h1a[0]->SetFillColor(kRed-6); } TLegend *l = new TLegend(0.25, 0.75 - 0.0666 *(i + 1), 0.4, 0.75 - 0.0666 * i); l->SetBorderSize(0); // no border l->SetFillColor(0); // Legend background should be white l->SetTextSize(0.03); // Increase entry font size! l->AddEntry(h1a[i],( +msstr).c_str(),"f"); hs->Add(h1a[i]); c1->cd(); c1->cd()->SetLogy(); // <<<--------------------- When i set logy, I cant setminium for the THStack hs->Draw((i ? "SAME hist" : "hist" )); l->Draw((i ? "SAME" : "" )); } }