Explaining box of different lines

Hi All,
I would like to explain my lines in a box. How can I menage?
For instance I have to graph in one canvas. One of them belongs to sinx and the other is cosx.
cosx is red line, sinx is dashed blue line .
I want to specify these in a box on the top-corner of the canvas.
Best wishes
Serkan[/img]

see class TLegend at root.cern.ch/root/html/TLegend.html (see examples)

Rene

thank you very much
best regards