Setting colors for matplotlib in pyroot

Hello

While trying to create some pies, the following syntax works fine

patches, texts = plt.pie(sizes, colors=colors, shadow=True, startangle=90)

if for example one uses colors like

colors = [‘yellowgreen’, ‘gold’, ‘lightskyblue’, ‘lightcoral’]

However, if I try to pass in TColors, like

colors = {kAzure-9, kMagenta-10,kBlue-8, kRed}

I get

facecolor=colors[i % len(colors)],
TypeError: ‘set’ object does not support indexing

So, is there a way to use ROOT colors with matplotlib ?

You probably need to create additional colors in matplotlib from:
TROOT::GetColor
TColor::GetRGB
TColor::GetAlpha

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.