verde.maxabs

verde.maxabs(*args)[source]

Calculate the maximum absolute value of the given array(s).

Use this to set the limits of your colorbars and center them on zero.

Parameters:
args

One or more arrays. If more than one are given, a single maximum will be calculated across all arrays.

Returns:
maxabs : float

The maximum absolute value across all arrays.

Examples

>>> maxabs((1, -10, 25, 2, 3))
25
>>> maxabs((1, -10.5, 25, 2), (0.1, 100, -500), (-200, -300, -0.1, -499))
500.0