14 misplaced lines of code are all it takes

... to break Y axis rescaling.