_ROOT Version: 6.13/02
Platform: Not Provided
Compiler: Not Provided
Hi there! I’ve been messing around with making some custom palettes in root. I’ve gotten it to a point where ROOT.TColor.CreateGradientColorTable
works fine, but I’ve been getting the following error;
TypeError: void TStyle::SetPalette(int ncolors = kBird, int* colors = 0, float alpha = 1.) =>
could not convert argument 2
Below the relevant portion of my code;
Number = 5;
lsflag= []
r = np.array([0.8, 1.0, 1.0, 0.8, 0.64], float)
g =np.array([ 0.15, 0.6, 1.0, 0.4, 0.0], float)
b=np.array([ .0, .3, 1.0, 0.65, 0.38], float)
stop = np.array([ 0, 0.2, 0.4, 0.6, 1], float)
FI=ROOT.TColor.CreateGradientColorTable(Number,r,g,b,stop,Steps)
print('The FI =', FI)
for i in range(Steps):
lsflag.append(FI+i)
#Making the histograms
#=======================================================
hresMatrix = MatrixToHist(resMatrix,"hresMatrix", 0.8, 0.2)
hresMatrix_graph = ROOT.TCanvas('hresMatrix_graph', 'c1', 500, 500)
hresMatrix_graph.cd()
ROOT.gStyle.SetOptStat(0)
ROOT.gStyle.SetPalette(Steps, lsflag);