colour.utilities.interval#
- colour.utilities.interval(distribution: ArrayLike, unique: bool = True) NDArray [source]#
Return the interval size of given distribution.
- Parameters:
distribution (ArrayLike) – Distribution to retrieve the interval.
unique (bool) – Whether to return unique intervals if the distribution is non-uniformly spaced or the complete intervals
- Returns:
Distribution interval.
- Return type:
Examples
Uniformly spaced variable:
>>> y = np.array([1, 2, 3, 4, 5]) >>> interval(y) array([ 1.]) >>> interval(y, False) array([ 1., 1., 1., 1.])
Non-uniformly spaced variable:
>>> y = np.array([1, 2, 3, 4, 8]) >>> interval(y) array([ 1., 4.]) >>> interval(y, False) array([ 1., 1., 1., 4.])