This pull request addresses an issue in the rescale01 function where constant or non-varying input values (including a uniform xlim) led to a division by zero, causing errors in data scaling. I've introduced a safeguard mechanism that:
Checks for the scenario where the range (rng) derived from the input x or provided xlim is constant or non-varying.
I've also implemented a fallback strategy by slightly modifying rng to introduce a minimal range, allowing the scaling operation to proceed without division by zero errors.
This pull request addresses an issue in the rescale01 function where constant or non-varying input values (including a uniform xlim) led to a division by zero, causing errors in data scaling. I've introduced a safeguard mechanism that:
Checks for the scenario where the range (rng) derived from the input x or provided xlim is constant or non-varying. I've also implemented a fallback strategy by slightly modifying rng to introduce a minimal range, allowing the scaling operation to proceed without division by zero errors.