I’m wondering if there’s a way to set the draw style of the TH1 histograms that are created and displayed from a TH2::SetShowProjectionX or TH2::SetShowProjectionY. Often ROOT defaults to drawing with error bars and this is not necessarily the best for me. I can change the behavior for by calling TH1::SetDrawOption for the TH1 that is created, but this resets as soon as I change the projected region.
That’s certainly possible - but this is something that I want to do interactively fairly regularly, rather than running a custom function/script every time. I was hoping that there was some global option for default TH1 draw style or something that would be simple to change
Unfortunately doesn’t seem to make any difference. I should say these are histograms that don’t have sqrt(N) errors - I’ve called hist->SetBinError() for each bin.
I see. I guess there is nothing we can easily do at that point. See the painting code of SetShowProjectionX. At the end of this method the projection drawing is done with:
hp->SetXTitle(fH->GetXaxis()->GetTitle());
hp->SetYTitle("Number of Entries");
hp->Draw();
c->Update();
padsav->cd();
hp the the TH1D holding the projection. As you see hp is drawn without any option. Therefore if it has errors (which is apparently the case) they will be drawn.
Note that drawing the TH2D with option HIST has no effect in that case, expect drawing it which option HISTwhich is a bit ugly . COL is better for this TH2D.
Ok, that’s a shame. Obviously it would involve changing the source, but would it be an idea to pass a draw option through SetShowProjectionX to the hp->Draw() call?