Added function to set interval between x-values