Added margin to allow last data point to be saved