Change default histogram draw options?

I can change the draw options of a specific histogram by doing:

TH2F fun(“fun”,"",10,0.,10,10,0,10);

(To my surprise, fun.SetDrawOption(“COLZ”) does nothing).

But I have dozens of histograms, so it would be very tiresome to have to call SetOption for each of them individually. Is it possible to change the default drawing options of all 2D histograms ? e.g.:


It would also be extremely useful if you could add an option to TBrowser to let one change the default TH1 and TH2 drawing options that it uses.

                            Ian Tomalin

This facility already exists in TBrowser.

Thanks for your reply. I am using ROOT version 5.18/00a, but see no sign of this option (to set the default draw option for a given histogram type) in TBrowser.

The only thing I can do in TBrowser is to draw an individual histogram, then right-click on it, and select “SetDrawOption”. This works. However, it is very tiresome to do this for each individual histogram, if one has dozens to display.

Is the option in TBrowser, to set the Draw Option for all histograms of a given type, only available in a more recent version of ROOT ?

                                Ian Tomalin

In the top right side, you have an empty box with label option.
Type your preferred option in side.



I wonder if it is possible to go a little further in flexibility and add another menu to choose default action for double-clicking particular objects ?

For example, I want to draw all 1D histograms with a particular name with a given sub-range in X-axis.