Hi,
I would like to make a plot containing two histograms, one drawn with COLZ option and one drawn with CONT1. I would like the colors used for the contours (predefined) to match up to the corresponding colors of the first histograms z-axis TPaletteAxis. But I can’t work out how to do the contour plot without altering the COLZ plot’s palette.
Here’s what I mean (lets say both histograms contain values ranging from 0 to 1).:
hist1->Draw("COLZ");
TPaletteAxis* p = (TPaletteAxis*)hist1->GetListOfFunctions()->FindObject("Palette");
double contours[5] = {0.7,0.8,0.9,0.95,0.99};
hist2->SetContour(5,contours);
int cols[5];
for(int i=0;i<5;i++) cols[i] = p->GetValueColor(contours[i]);
gStyle->SetPalette(5,cols);
hist2->Draw("CONT1");
The problem with the above code is that the call to gStyle->SetPalette causes the COLZ plot to pick up this new, very limited set of colors. Is it possible to draw the contour plot and specify the set of colors to use, without changing the gStyle palette?
Thanks
Will