ROOT Version: 6.22.08 for linux Platform: WSL Ubuntu 20 Compiler: g++
Hi all,
I would like to know if there is some ‘clear’ way to prepare visuals before I actually start my drawings.
What I am doing :
I am about to draw some histograms and TF1s on a single canvas in a loop (let’s say for example 6 TF1s and 6 histograms). For sure, I’d like to have all the stuff like fonts, offset, axes titles set, but afaik this stuff is set basing on my FIRST drawing. In my case, I believe this will lead to a code duplication, and I’d like to avoid it (let me know if it’s actually okay).
What I tried :
I tried to draw a dummy histogram (initialized with empty constructor) and apply all the settings I like to it. Apparently, none of things I did for that dummy histogram took effect (commenting its code changes nothing).
Please let me know if you know some working & nice solution to it.
Hi,
Thank you for your suggestion. It seems that gStyle function signatures do not really match with those of TH1D. Some of them (for example gStyle->SetTitleX) I find really uncommon. Could you please show me how do I rewrite the following?
Hi,
depends on what you call “not working as expected”. It will probably work if I just initialize a first histogram manually (out of a loop), but as I said I expect redundant code in that case.
Instead of doing
initialize_visuals_and_dostuff();
for(loop without 1st){
dostuff();
}
It, however, have not been working until I changed Fit options (yes, I perform a fit) from “RM” to “RM0” (documentation says that with ‘0’ code won’t plot figure automatically when fit is called). I do not know exact magic behind this (only a few ideas), but it works.