How to set axes in log scale for a histogram without calling

Hi, Rooters,

I have some histograms which have been filled in a script without opening TCanvas and TPad.
So, examples like this don’t help me much, … les.C.html.

Although I’ve tried a lot, still stuck.
Do your guys have any comments to fix it ?
Thanks !


My code is something like this.

        TH1F hist // histogram definition here.
        for(int i=0;i<npix;++i){

TPad::SetLog[xyz] methods do NOT influence the histogram itself. They just modify the way the histogram is drawn in the current pad.
Search for “variable bin size” in the TH1 class description and see the “ROOT User’s Guide -> Histograms -> Creating Histograms -> Constant or Variable Bin Width” subsection.

The log sale is not an attribute of the histogram, but and attribute of the Pad. If you save the canvas instead of the histogram then the log attribute will be kept.