Hello ROOT experts,
I’m using the rainbow palette one obtains with gStyle->SetPalette(1). When I draw a 2D histogram with “colz”, I’d like to have a smooth transition between colors, instead of the 20 distinct ones I get now.
I even tried setting my own palette with 500 different colors, following the example in TColor.cxx. If I iterate over the list of colors and dump out their hues, I indeed see that all 500 are distinct. But, when I view/save the image, the colors still get binned into about 20. This is especially apparent if I save the file as a SVG and count the unique colors:
>>> set([y.split('fill="')[1].split('"')[0] for y in open('test.svg').readlines() if 'fill="' in y])
set(['#66ff00', '#ff3300', '#ffff00', '#ccff00', '#ff9900', '#ffcc00', '#0099ff', 'black', '#0066ff', '#00ff33', '#99ff00', '#00ffff', '#0033ff', '#ff6600', '#00ff99', '#33ff00', '#ff0000', 'white', 'none', '#00ff66', '#00ffcc', '#00ff00', '#00ccff'])
>>> len(_)
23
Is there some binning in the color (z) axis that needs to be increased to get what I want?
Test script attached. I’m using ROOT 5.22/00a as installed on lxplus.
Thanks,
Jordan
colors.C (2.08 KB)