{ int i; const Int_t nx = 8; string os_X[nx] = {"8","32","128","512","2048","8192","32768","131072"}; float d_35_0[nx] = {0.75, -3.30, -0.92, 0.10, 0.08, -1.69, -1.29, -2.37}; float d_35_1[nx] = {1.01, -3.02, -0.65, 0.37, 0.34, -1.42, -1.02, -2.10}; auto cbh = new TCanvas("cbh","cbh",400,600); cbh->SetGrid(); auto h1bh = new TH1F("h1bh","Option HBAR centered on 0",nx,0,nx); h1bh->SetFillColor(4); h1bh->SetBarWidth(0.4); h1bh->SetBarOffset(0.1); h1bh->SetStats(0); h1bh->SetMinimum(-5); h1bh->SetMaximum(5); for (i=1; i<=nx; i++) { h1bh->Fill(os_X[i-1].c_str(), d_35_0[i-1]); h1bh->GetXaxis()->SetBinLabel(i,os_X[i-1].c_str()); } h1bh->Draw("hbar min0"); auto h2bh = new TH1F("h2bh","h2bh",nx,0,nx); h2bh->SetFillColor(38); h2bh->SetBarWidth(0.4); h2bh->SetBarOffset(0.5); h2bh->SetStats(0); for (i=1;i<=nx;i++) h2bh->Fill(os_X[i-1].c_str(), d_35_1[i-1]); h2bh->Draw("hbar min0 same"); }