I would like to get rid of the red line around my histogram. Please see the attached histogram; for some reason, if I set the fill color of canvas to be 0 using TStyle, the red line comes up as a side effect and I cannot figure out how to get rid of it.
I would also like to make the line width of the axis to be the same as that of the histogram line width and again I failed to find out how.
Actually I would also like to set the line width of the stats box. I can chose either this thicknes or no line. Is there a way around?
Could you please teach me how to do these things?
Thank you for your help in advance.
FYI, I am using Root 5 on MacOSX with PyROOT. though I cannot think of my environment affecting this problem…
The red line around the pad is not visible anymore when you save a pad in a bitmap file. By default the stat box’s line width is one pixel. You should have change it in order to get this output. Do you have a small macro reproducing your problem ?
Thank you for your reply.
Unfortunately your point is not valid since the attached picture was
cut from a screen shot of pdf file saved from the canvas I made and
it even shows up when I print the pdf file.
I’m trying to plot 36 histogram at once and this effect is particularly
bad since it seems there seems to be a minimum width for this red
line and the stat box line and no matter how small the histogram is,
they maintain certain thickness. I tried ps and png format and the result
is the same.
Following is a simple script to reproduce the problem.
If I comment out mystyle.SetCanvasColor(0),
the red line will not appear though the thickness of the stat box is
still very thick compared to the histogram line width. True I am
setting mystyle.SetHistLineWidth(0) but if I do
mystyle.SetStatBorderSize(0) then the stat box line will dissappear
instead of becoming the same width as the histo line width.
Could you please take a look?
Thanks
Akira
from ROOT import *
fileName="user.AkiraShibata.000001.T1.try3.AANT1.merged.root"
## style
mystyle=TStyle("mystyle", "my custom style")
mystyle.SetCanvasColor(0)
mystyle.SetTitleFillColor(0)
mystyle.SetTitleBorderSize(0)
mystyle.SetStatColor(0)
mystyle.SetHistLineWidth(0)
gROOT.SetStyle("mystyle")
# read in ntuple
CollectionTree=TChain("CollectionTree")
EV0=TChain("EV0")
EVCands=TChain("EVCands")
# list of all chains
chains=[CollectionTree,EV0,EVCands]
for i in chains:
i.Add(fileName)
chain=EVCands
canvas=TCanvas()
canvas.SetCanvasSize(1200, 1200)
canvas.Divide(6,6)
histo=TH1F("histo","histogram",100,10000,200000)
chain.Draw("TJet_p_T>>histo","","goff")
for i in xrange(36):
canvas.cd(i+1)
histo.Draw("")
canvas.Print("test.pdf")
I cannot run the example you sent. It is just a copy/paste of a part of a larger program. I do not have the files it uses. Please send me something I can run which reproduces the problem.
It is not a part of a larger program. I wrote this especially for you!
Do you want me to send you to attach the ntuple as well? You can
just change the lines where I’m reading in the file to the chain and
change the name of the tree and variable name to plot.
OK, I’ll make a small Ntuple so I can upload here.
OK, so using my own style is making histogram behave funny.
It seems that TStyle default for FrameBorderMode is 1, so if I
apply my style, this default will be propagated to the gStyle?