Hello
I have two TH2 histograms that I want to draw on the same pad, superimposed.
To be able to see both, one is to be drawn as COL, while the other as one as CONT1 (which shows the absolute height as line color).
However, I cannot figure out how to match the scales in z. I can do it when both histograms are drawn as COL, but not if the second one is drawn as CONT1.
Here is a macro showing what I’m trying to do (CONT0 helps visualizing, but CONT1 is the same)
void colcontsame() {
TH2F *h1 = new TH2F("h1","h1",10,-2,2,10,-2,2);
TH2F *h2 = new TH2F("h2","h2",10,-2,2,10,-2,2);
TH2F *h3 = new TH2F("h3","h3",10,-2,2,10,-2,2);
for (Int_t i=0;i<1000000;i++) {
double x,y;
gRandom->Rannor(x,y);
if(x<0 && y<0) h1->Fill(x,y, 5);
if(x>0.4 && y>0.4) h2->Fill(x,y);
if(x>0.4 && y<-0.4) h3->Fill(x,y);
}
h1->Draw("COLZ TEXT");
h2->Draw("CONT0 SAME");
h3->Draw("COL TEXT SAME"); // works if I use COL again
}
While h3 is correctly drawn as all dark blue (since it falls in the lowest z-bins of h1), h2 is drawn as if it had bins of the same order as h1 and seemingly has its own z-scale.
Am I missing some option? Is this supported at all?
Thank you in advance.