Reverse color palette direction

If I am plotting a TH2 with option “colz” and have called

the color palette will range from red (high values) through yellow, green, blue, and finally purple (low values).

Is it possible to reverse the direction of the color palette, so purple is assigned to the highest values, etc.?

1 Like

root.cern.ch/drupal/content/how … or-palette
and also:
root.cern.ch/drupal/content/rainbow-color-map

While those links are useful in general, they do not answer my question.

From root.cern.ch/root/html/TColor.h … SetPalette:

Is the specification for this palette given somewhere, so that it would be possible to use CreateGradientColorTable to define the reversed palette?

  const UInt_t NRGBs = 5;
  Double_t stops[NRGBs] = { 0.00, 0.34, 0.61, 0.84, 1.00 };
  Double_t red[NRGBs]   = { 0.51, 1.00, 0.87, 0.00, 0.00 };
  Double_t green[NRGBs] = { 0.00, 0.20, 1.00, 0.81, 0.00 };
  Double_t blue[NRGBs]  = { 0.00, 0.00, 0.12, 1.00, 0.51 };
  const Int_t NCont=255;
  TColor::CreateGradientColorTable(NRGBs,stops,red,green,blue,NCont);