Hello ROOTers,
I’m using the following script to display 2-d histograms with color.
UInt_t Number = 3;
Double_t Red[Number] = { 1.00, 0.00, 0.00};
Double_t Green[Number] = { 0.00, 1.00, 0.00};
Double_t Blue[Number] = { 1.00, 0.00, 1.00};
Double_t Length[Number] = { 0.00, 0.50, 1.00 };
Int_t nb=50;
TColor::CreateGradientColorTable(Number,Length,Red,Green,Blue,nb);
root.cern.ch/root/html/TColor.html
The issue i have is when i zoom the scale, the root recalculate the color range and change the color for data values.
I think this is because root uses the stops as fraction of whole range.
Int_t CreateGradientColorTable(UInt_t Number, Double_t* Stops, Double_t* Red, Double_t* Green, Double_t* Blue, UInt_t NColors, Float_t alpha = 1.)
So if you change the zoom scale(data range) you will get different color for a given data value.
I want the same color for the same data value even if i change the zoom range.
For example, i have data spanning negative to positive values in a 2-d histogram and i want ‘zero’ allways have the same color.
Can i do it?
If then, how?
It would be very appreciated if you could give some help on this issue.
Thanks,