Hi! I have to draw a number of TH1s in the same pad and i would like to set the color somehow automatically…
for TH2 there is the mechanics of SetContour that takes an array of numerical limits the automatically color the areas.
Could be possible to have something like
Color_t* GetColorArray( Int_t nlevels, const Double_t * levels = 0) that would return an array of Color_t (shorts) where the output elements is an color array mapped to the levels elements?
Hi! No, i was not aware of this … very nice … i was looking over the class reference and while example is clear for a TF2 (or any T*2 that have SetContour) it is not clear to my how can i extract ordered colors from the gradient in order to have something like
h1->SetMarkerColor(color_array[0]);
…
…
h5->SetMarkerColor(color_array[4]);
i also discovered ->Draw(“SAME PLC PMC”);
which is very nice but it not controllable (or i did not found out how to do it …)
So what you want to do is to define a color map and pick a color in it according to a value range mapped on this color map ? … what the option COL does for you in fact …
the problem is that there is no exposed mechanics for getting a color
range (something like : this is the palette, split in 10, get me the
color at index Idx)
I apologize if i fail to make myself understood (again)