void hbars() { double alice_offline[] = {6e7, 2e8, 5e8}; double frib_offline[] = {1e6, 1e7, 2e7}; double eic_offline[] = {150e3, 2.9e6, 1e8}; double clas12_offline[] = {250e6, 500e6, 500e6}; double gluex_offline[] = {90e6, 200e6, 400e6}; double star_offline[] = {150e6, 400e6, 400e6 }; double sphenix_offline[] = {60e6, 500e6, 750e6}; TH1F *halice = new TH1F("halice","ALICE offline cpu-hr/yr", T->Draw("Division>>hDiv","","goff"); TH1F *hDiv = (TH1F*)gDirectory->Get("hDiv"); hDiv->SetStats(0); TH1F *hDivFR = (TH1F*)hDiv->Clone("hDivFR"); T->Draw("Division>>hDivFR","Nation==\"FR\"","goff"); hDiv->SetBarWidth(0.5); //hDiv->SetBarOffset(0.1); hDiv->SetFillColor(49); //TH1 *h1 = hDiv->DrawCopy("bar2"); hDivFR->SetBarWidth(0.5); //hDivFR->SetBarOffset(0.1); hDivFR->SetFillColor(50); //TH1 *h2 = hDivFR->DrawCopy("bar2,same"); THStack *a = new THStack("a","Stacked histograms"); a->Add(hDiv); a->Add(hDivFR); a->Draw("bar2"); TLegend *legend = new TLegend(0.55,0.65,0.76,0.82); legend->AddEntry(h1,"All nations","f"); legend->AddEntry(h2,"French only","f"); legend->Draw(); c1->cd(); delete f; }