fixed bug on line using numpy.arange imprecisely

The former code would sometimes produce one more array element than expected. 
This fixes that using numpy.arange with integer values, but numpy.linspace would
also work.