Invert x and y axis in peaks detection