Adding text to a histogram drawn with cont4

Hello,

I want to add some text to a 2D histogram drawn with “CONT4” but the text is not displayed. However if I draw the histogram with “COL”, then the text is drawn.

Is there any possibility to add text to a histogram drawn with “CONT4”?

Thanks,
Andreas

ROOT version: 5.02/00
OS: Suse 9.2

Example:

void CONT()
{
TH2D* Cont = new TH2D(“Cont”, “Cont”, 100, 10, 20, 100, 10, 20);

for (int bx = 1; bx <= 100; bx++) {
for (int by = 1; by <= 100; by++) {
Cont->SetBinContent(bx, by, bx+by);
}
}

// Cont->Draw(“col”); // Text is displayed
Cont->Draw(“cont4”); // Text not displayed

TLatex* tex = new TLatex(15, 15, “Text”);
tex->Draw();
}

The cont4 option is done using a surface plot seen from the top. This drawing uses some normalized coordinates, therefore a text in user coordinates does not show. Try:

{
        TH2D* Cont = new TH2D("Cont", "Cont", 100, 10, 20, 100, 10, 20);
                                                                                
        for (int bx = 1; bx <= 100; bx++) {
                for (int by = 1; by <= 100; by++) {
                        Cont->SetBinContent(bx, by, bx+by);
                }
        }
                                                                                
        // Cont->Draw("col"); // Text is displayed
        Cont->Draw("cont4"); // Text not displayed
                                                                                
        TLatex* tex = new TLatex(.1, .1, "Text");
        tex->Draw();
}