Raise ValueError if converted limits are non-finite. Note that this function also accepts None as a limit argument. Returns ------- The limit value after call to convert(), or None if limit is None.
(self, limit, convert)
| 3873 | return tuple(self.viewLim.intervalx) |
| 3874 | |
| 3875 | def _validate_converted_limits(self, limit, convert): |
| 3876 | """ |
| 3877 | Raise ValueError if converted limits are non-finite. |
| 3878 | |
| 3879 | Note that this function also accepts None as a limit argument. |
| 3880 | |
| 3881 | Returns |
| 3882 | ------- |
| 3883 | The limit value after call to convert(), or None if limit is None. |
| 3884 | """ |
| 3885 | if limit is not None: |
| 3886 | converted_limit = convert(limit) |
| 3887 | if isinstance(converted_limit, np.ndarray): |
| 3888 | converted_limit = converted_limit.squeeze() |
| 3889 | if (isinstance(converted_limit, Real) |
| 3890 | and not np.isfinite(converted_limit)): |
| 3891 | raise ValueError("Axis limits cannot be NaN or Inf") |
| 3892 | return converted_limit |
| 3893 | |
| 3894 | def set_xlim(self, left=None, right=None, *, emit=True, auto=False, |
| 3895 | xmin=None, xmax=None): |
no test coverage detected