Improved y-axis scaling

- Scaling of y-axis now only takes into y-values within the given x-axis
range (prevents bad scaling due to large/small numbers outside of
x-range)