Correctly take into account negative values for Y axis scaling