holoviews.util.locator module#
Minimal set of functionality of Matplotlib’s MaxNLocator to choose contour levels without having to have Matplotlib installed. Taken from Matplotlib 3.8.0.
- holoviews.util.locator.nonsingular(vmin, vmax, expander=0.001, tiny=1e-15, increasing=True)[source]#
Modify the endpoints of a range as needed to avoid singularities.
Parameters#
- vmin, vmaxfloat
The initial endpoints.
- expanderfloat, default: 0.001
Fractional amount by which vmin and vmax are expanded if the original interval is too small, based on tiny.
- tinyfloat, default: 1e-15
Threshold for the ratio of the interval to the maximum absolute value of its endpoints. If the interval is smaller than this, it will be expanded. This value should be around 1e-15 or larger; otherwise the interval will be approaching the double precision resolution limit.
- increasingbool, default: True
If True, swap vmin, vmax if vmin > vmax.
Returns#
- vmin, vmaxfloat
Endpoints, expanded and/or swapped if necessary. If either input is inf or NaN, or if both inputs are 0 or very close to zero, it returns -expander, expander.