Creating a Legend

I am trying to draw a legend on the attached graph. I don’t think I am defining my pad co-ordinates correctly. How do I work out the values for x1, y1, x2, y2?
the data is in a .dat file and is as follows:
350 0.91 0.97
355 0.92 0.97
360 0.93 0.97
365 0.93 0.97
370 0.94 0.97
375 0.94 0.97
380 0.95 0.97
385 0.95 0.98
390 0.95 0.98
395 0.96 0.98
400 0.96 0.98
405 0.96 0.98
410 0.97 0.98
415 0.97 0.98
420 0.97 0.98
425 0.97 0.98
430 0.97 0.99
435 0.98 0.99
440 0.98 0.99
445 0.98 0.99
450 0.98 0.99
455 0.98 0.99
460 0.98 0.99
465 0.99 1
470 0.99 1
475 0.99 1
480 0.99 1
485 1 1
490 1 1
495 1 1.01
500 1 1.01
505 1 1.01
510 1 1.01
515 1.01 1.01
520 1.01 1.01
525 1.01 1.01
530 1.01 1.01
535 1.01 1.01
540 1.01 1.01
545 1.01 1.01
550 1.01 1.02
555 1.01 1.02
560 1.01 1.02
565 1.01 1.02
570 1.01 1.02
575 1.01 1.02
580 1.01 1.02
585 1.01 1.02
590 1.01 1.02
595 1.01 1.02
600 1.01 1.02
605 1.01 1.02
610 1.01 1.02
615 1.01 1.02
620 1.01 1.02
625 1.01 1.02
630 1.01 1.02
635 1.01 1.02
640 1.01 1.02
645 1.01 1.02
650 1.01 1.02
655 1.01 1.02
660 1.02 1.02
665 1.02 1.02
670 1.02 1.02
675 1.02 1.02
680 1.02 1.02
685 1.02 1.02
690 1.01 1.02
695 1.01 1.02
700 1.01 1.02

Kind regards
Marieke
ptfeboth.C (1.38 KB)

This one is working:

{
   gStyle->SetCanvasColor(10);
   gStyle->SetFrameFillColor(10);
   gStyle->SetOptStat(0);
                                                                                
   ifstream data;                        // declare a file to input from
                                                                                
   data.open("ptfeboth.dat");
                                                                                
   // number of points to be plotted
   const Int_t n = 71;
                                                                                
   //careful with no of points!
                                                                                
   Float_t x[n], y[n], y2[n];
                                                                                
   for(Int_t i=0;i<n;i++){
      data>>x[i]>>y[i]>>y2[i];
   }
                                                                                
   TGraph* inputSpec = new TGraph(n, x, y); //change for title as necessary
   TGraph* inputSpec2 = new TGraph(n, x, y2);
                                                                                
   inputSpec->SetTitle("Reflectance of Pressed PTFE Powder (2 days data)");
   inputSpec->GetXaxis()->SetTitle("Wavelength (nm)");
   inputSpec->GetYaxis()->SetTitle("Spectral Reflectance");
   inputSpec->SetMaximum(1.04);
   inputSpec->SetMinimum(0);
   inputSpec->Draw("AC");
   gPad->Update();
   inputSpec2->SetLineStyle(kDotted);
   inputSpec2->Draw("CP");
                                                                                
   TLegend *legend = new TLegend(0.1,0.1,0.5,0.5, "");
   legend->AddEntry(inputSpec, "27/06/05", "l");
   legend->AddEntry(inputSpec2, "28/06/05", "l");
   legend->Draw();
}