Position of legend

The position of a legend is defined when you create it: Example:

{
   TFile f("hsimple.root");
   hpx->SetFillColor(48);
   hpx->SetMarkerStyle(20);
   hpx->SetMarkerSize(1);
   hpx->Draw("HP");
   TLegend *leg=new TLegend(0.2,0.2,0.4,0.4);
   leg->AddEntry(hpx,"hpx","fp");
   leg->SetTextFont(132);
   leg->SetHeader("Legend");
   leg->SetTextFont(42);
   leg->Draw();
}