clamp axis_threshold to avoid potential floating point issues.