meixue
1
I want to change the color of one part of a histogram to highlight this part, like the red one. How should I do?
couet
2
void highlighthist() {
auto h1 = new TH1F("h1", "h1", 100, -5., 5.) ; h1->FillRandom("gaus", 10000);
auto h2 = (TH1F*)h1->Clone();
h2->SetFillColor(kBlue-3);
h1->Draw();
h2->GetXaxis()->SetRangeUser(0, 1);
h2->Draw("SAME");
}
meixue
3
Thankyou! But I prefer to set the whole histogram of this part to another color like this picture

couet
4
To obtain the last picture you sent, simply draw a TBox on top of your histogram.
meixue
5
How do I set any color in this plot?