Changing x-axis of TGraph

To go outside the existing data points (or bins), use SetLimits; to ‘zoom in’ within the limits, use SetRangeUser (for axis values) or SetRange (for bin numbers); in all cases, first you get the axis. For your example:

  gt->GetXaxis()->SetLimits(1, 20);