Set View Window on X-Axis

I’m creating a graph from a file, but I can’t set the range on the x-axis. How can I set the range for the x-axis?

Thanks!

{
  g = new TGraph("Sample72.txt");
  g->SetTitle(" PWO Sample 72 - Transverse Optical Transmittance; Position (mm); Optical Transmittance (%);");
  g->SetMinimum(0);
  g->SetMaximum(100);
  g->Draw("ALP");
}

g->GetXaxis()->SetLimits(xmin, xmax);

1 Like