Getting old palettes

Hello,

I’ve noticed that the standard palettes between ROOT 5 and ROOT 6 differ. I guess this is related to the change documented in TColor class reference as:

“6.04: 62 high quality palettes are predefined with 255 colors each. Despite the disadvantages of the Rainbow color map, it was kept in the list of predefined color maps. These palettes can be accessed “by name” with gStyle->SetPalette(num). num can be taken within the following enum:”

However, new palettes differ from the old ones. DarkBodyRaidiator now and before includes different colours. For the sake of producing consistent plots, it would be nice to get the old palettes in current ROOT. Are thery still kept somewhere, or do I have to manually import old ones from old TColor, just giving them some different enums? If it is the latter case, would you consider adding old palettes with some differen enums or a flag to current ROOT?

DarkBodyRadiator is still there … can you provide an example showing the changed behaviour ?

That’s actually inverse body radiator that I am using. I attach screenshots with root5 and root6.


Btw. one can notice that also the size of window changes slightly between the screenshots, and it was just TCanvas:SaveAs(). Is this difference expected?

Do you have a simple script ?

Just created drawing simple 2D gauss. Same effect with palette and canvas size tiny change.

I run it with: python palette_test.py

palette_test.py (299 Bytes)

Thanks. I transformed it into:

void palette_test()
{
   gStyle->SetPalette(56);
   TF2 *f = new TF2("f", "xygaus");
   f->SetParameters(1, 1, 0.5, 1, 0.5);
   f->SetMinimum(0);
   f->SetMaximum(1);
   f->Draw("colz");
}

it gives me the two following plots: on the left ROOT 5.34 and on the right ROOT 6.13. I have some difficulties to see the difference between the two plots.

There is a difference. ROOT 5 colors are brighter and more saturated. Especially the part close to 0 is brighter. Also, root 6 colors seem to include some kind of hue. It is much better visible in original screenshots that I’ve provided. You can’t see it there either?

Ah yes I see that the palette definition in ROOT 5 was less precise than it is now in ROOT 6. You can define the palette using the ROOT 5 definition and you will get the same result with ROOT 6. The code is:

void palette_test()
{
   const Int_t nRGBs = 5;
   Double_t stops[nRGBs] = { 0.00, 0.25, 0.50, 0.75, 1.00};
   Double_t red[nRGBs]   = { 1.00, 1.00, 1.00, 0.50, 0.00};
   Double_t green[nRGBs] = { 1.00, 1.00, 0.55, 0.00, 0.00};
   Double_t blue[nRGBs]  = { 1.00, 0.00, 0.00, 0.00, 0.00};
   TColor::CreateGradientColorTable(nRGBs, stops, red, green, blue, 255, 1.);
   TF2 *f = new TF2("f", "xygaus");
   f->SetParameters(1, 1, 0.5, 1, 0.5);
   f->SetMinimum(0);
   f->SetMaximum(1);
   f->Draw("colz");
}

OK, I knew that and was just wondering if you kept old definitions somewhere for sake of consistency.

No. if you want some “old palette” you need to go back to ROOT 5 source and pick it from there. As I did with your example.

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