MCPcopy
hub / github.com/pydata/xarray / _get_nice_quiver_magnitude

Function _get_nice_quiver_magnitude

xarray/plot/utils.py:975–981  ·  view source on GitHub ↗
(u, v)

Source from the content-addressed store, hash-verified

973
974
975def _get_nice_quiver_magnitude(u, v):
976 import matplotlib as mpl
977
978 ticker = mpl.ticker.MaxNLocator(3)
979 mean = np.mean(np.hypot(u.to_numpy(), v.to_numpy()))
980 magnitude = ticker.tick_values(0, mean)[-2]
981 return magnitude
982
983
984# Copied from matplotlib, tweaked so func can return strings.

Callers 2

newplotfuncFunction · 0.90
add_quiverkeyMethod · 0.90

Calls 2

meanMethod · 0.45
to_numpyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…