Stephen_Eichblatt wrote:
> Hi,
>
> I am trying to draw a histogram in a pad and then place some text at a given
> location in the pad. (eg. the center of the pad).
> But it seems that the co-ordinate frame in the pad goes to the histogram co-ordinates
> once the histogram is drawn, so finding the center of the pad depends on the histogram.
>
> I thought the Pad->DrawTextNDC(0.5,0.5,"hello") would work, but it doesn't
> do what i thought (it does nothing as far as i can see).
>
> Other than getting the histogram information, is there a way to position text
> in a pad?
In the current version 1.03, you cannot draw directly a TText in NDC,
other than getting the histogram information.
I have implemented this feature in our dev version.
You can use a TPaveLabel however. Example:
TPaveLabel *label = new TPaveLabel(0.4,0.45,0.5,0.55,"Hello","brNDC");
label->Draw();
You can get vthe text only via a trick
label->SetFillColor(gPad->GetFillColor());
label->SetBorderSize(0);
Rene Brun