Hi all,
I would like to draw a TLine under the histogram, not over the histogram.
So far my workaround is to plot the histogram twice…
Is there a more convinient way to do that?
// foxwise.cpp
void foxwise(){
TCanvas* canvas = new TCanvas();
TH1F* h = new TH1F("h", "", 100, -10, 10);
h->FillRandom("gaus", 100000);
h->SetLineWidth(3);
TLine* l = new TLine(-5, 0, 5, h->GetMaximum());
l->SetLineColor(4);
l->SetLineWidth(8);
l->SetLineStyle(9);
//works but line is OVER the histogram
// h->Draw();
// l->Draw();
// line isn't drawn
// l->Draw();
// h->Draw();
// empty canvas
// l->Draw();
// h->Draw("same");
// my workaround for now...
h->Draw();
l->Draw();
h->Draw("same");
canvas->Update();
}