The averaging procedure will in general not give reasonable average potentials in the ends of the x-range, so in script line 531 the x-axis limits are set according to variables that are calculated from the averaging parameters. Simply comment out line 531 in order to see the full range.