Modified plotting functions to do more robust ratio computation.