xoa.core.plot.get_stick_scale

xoa.core.plot.get_stick_scale#

xoa.core.plot.get_stick_scale(u, v, length=None, percentile=99.0)[source]#

Get the quiver scale of sticks so that the strong ones span a fraction of the axes width

The strong speed is a high percentile of the speeds, so that a few peaks do not shrink all the sticks.

Parameters:
  • u (array_like) – Components of the vectors, with possibly missing values

  • v (array_like) – Components of the vectors, with possibly missing values

  • length (None, float) – Length of the strong sticks in fraction of the width of the axes, which defaults to the plot.stick_length option

  • percentile (float) – Percentile of the speeds that gives the strong speed

Returns:

float, None – Scale to pass to matplotlib.axes.Axes.quiver() with scale_units="width", or None when there is no positive speed