Color set-up for histograms

Hello!

I was trying to use all the available colors, not only the basic ones. So I tried to use list like:

colors = ['kRed', 'kRed +10', 'kOrange + 10', 'kOrange']

in a loop through list of histograms:

for index in range(0,4):
    histograms[len(histograms)-4+index].SetLineColor(colors[index])

but it didn’t worked by me. Instead if I do so:

colors = [1,2,3,4,5,6,7']
....
for index in range(0,4):
    histograms[len(histograms)-4+index].SetLineColor(colors[index])

Everything works. So how can I use mnemonics in pyroot?

Hi,

the way in which you access an global enum, like the one where the constants kRed, KOrange… are stored, is ROOT..
In your example you use strings: replace ‘kRed’ with ROOT.kRed and so on.

Danilo