[solved] Saving a 2D histo in a rootfile with drawing opt.?


I can’t figure out how to save drawing options such as color palette or “colz” in a rootfile for a 2D histogram. Is it only possible ?

I think it is not for the palette, since it applies for the whole gStyle, but since it is possible to set the color of a 1D histogram, I guess it should be possible for the colz option… I tried histo->SetDrawOption(“colz”), which doesn’t seem to work.

Any suggestions ? Thanks.

Use TH1::SetOption instead of SetDrawOption

SetOption stores the option in the TH1 object. If TH1 is saved to a file
the option is saved too.

SetDrawOption applies to the already drawn histogram in the current pad.
This information is not persistent. It allows to draw the same histogram in
several pads with different drawing options.


That’s it ! Thanks.