hello, I am in lxplus (alma9) and I have an old python script that I used to plot some histograms and diagrams.
originaly I was using “from ROOT import *” but now I’ve got a message saying I need to specify what I want to import. Fine. Now I set it to “from ROOT import TH1, TBox”
This works, but if I try to set the color of the box with
box.SetFillColor(kGray)
the error I get is:
NameError: name ‘kGray’ is not defined.
I tried with “from ROOT import TH1, TBox, TColor”
but it does not work either.
Then I found the same error for the markers: kOpenCircle is not recognized
How can I set all the colors and marker styles by name (enum)?
>>> from ROOT import TBox, EColor
>>> b = TBox(0.2,0.2,0.5,0.5)
>>> b.SetFillColor(EColor.kTeal)
>>> b.Draw()
Info in <TCanvas::MakeDefCanvas>: created default TCanvas with name c1
>>>