MCPcopy
hub / github.com/matplotlib/matplotlib / _validate_converted_limits

Method _validate_converted_limits

lib/matplotlib/axes/_base.py:3875–3892  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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):

Callers 2

set_extentMethod · 0.80
_set_limMethod · 0.80

Calls 1

convertFunction · 0.50

Tested by

no test coverage detected