Setting multiple palettes

Hi all,

I am looking for a way to set multiple palettes for different TH2.
Currently I am doing this:

int meanMapCols[5] = { kBlue, kTeal, kWhite, kSpring, kRed};
int sigMapCols[5]  = { kBlue, kGreen, kYellow, kRed, kBlack};

TColor::SetPalette(5,meanMapCols);
c_hitResMeanMap->cd();
h_resMeanMap->Draw("COLZ");

TColor::SetPalette(5,sigMapCols);
c_hitResSigMap->cd();
h_resSigMap->Draw("COLZ");

Unfortunately, I get the same palette (the latter one) for both TH2. Is there a way to define the palette for a given TH2?

N.

root.cern.ch/drupal/content/how- … ame-canvas

Thanks for the reply.

Unfortunately I can’t figure out how to use TExec with an arbitrary list of parameters. The documentation is not very clear on how to do this.

I would like to use:
cols[5] = { … };
gStyle->SetPalette(5, cols)

Since SetPalette requires an array, I can’t call it directly and provide the color list inline.

N.

You can give a small piece of C code to TExec. See “Case 2” here:
root.cern.ch/root/html/TExec.html