void PaintBin (TH1 *h, Int_t bin, Int_t color) { printf("%d %d %d\n", bin, color, h->GetBinContent(bin)); TBox *b = new TBox(h->GetBinLowEdge(bin), h->GetMinimum(), h->GetBinWidth(bin)+h->GetBinLowEdge(bin), h->GetBinContent(bin)); b->SetFillColor(color); b->Draw(); } void bincolor() { TH1F *h1 = new TH1F("h1","h1",100,-10,10); h1->FillRandom("gaus"); h1->Draw(); PaintBin (h1, 60, kRed); PaintBin (h1, 50, kBlue); }