Adding text comments to histograms

Hi,
sorry if this is a trivial question, but how can I add text to a histogram?

I’ve been trying a TText object:

TText t1;
t1->SetTextColor(1);
t1->SetTextSize(.1);
t1->PaintTextNDC(.5,.5,“text”);

with no luck, thanks
Ken

PS this link is down:
root.cern.ch/gif/h1draw.gif

There is many examples in the tutorials directory of the ROOT distribution. They also are in the manual. An simple way to learn simple things like that, is to use the TCanvas graphics toolbar thanks to the menu View/Toolbar. Then you create a text by clicking on the L button. Then you save your canvas in a .C file with File/Save -> c1.C and you will get all the commands used to create the graphics you see in a macro (c1.C). That’s a very powerful way to learn the basic graphics objetcs in ROOT. If these hints do not help you send a small example in this forum showing your problem.

[quote=“kwd1”]PS this link is down:
root.cern.ch/gif/h1draw.gif[/quote]
Where do you see this link? What’s the referring page?
Axel.

Axel,

I suppose you mean:
root.cern.ch/root/html/gif/h1draw.gif

Rene

Hi Rene,
I’m trying to find out what page links this file using the wrong path.
Axel.

It was this liunk
root.cern.ch/root/html/examples/h1draw.C.html

fixed now, thanks!