Problem with Style for Axis

Dear all,

I have the following problem I’m using a macro where I have defined
all the needed style setting and I load it in the macro that I’m using for producing plots in the following way:

gROOT->ProcessLine(".L tdrstyle.C");


In this macro I’m plotting two kind of object:

a) I’m plotting TH1F * defined inside the macro

b) I’m plotting after some manipulation also TProfile that
I have in separate root files and that I take them as follow:
TFile * mb = new TFile(“fileName.root”);
TProfile * plotMBdNMC = (TProfile*)mb->Get(“profileName”);

In plots provided for the case a) everything is ok, but when I try to produce
the plots for the case b) I have some trouble with the axis style.

Please some one could explain me what I have to do in order to apply
the style correction to the axis also in the case b)

Thanks a lot for the help.


When reading objects from a file, these objects have their attributes kept from the session where you wrote the file.
You can force the current style to be applied by calling

gROOT->ForceStyle(); at the beginning of your program (at least before reading the objects from the file)


HI Rene,
thanks it works.

The line has to be put also
before the style definition.