quiver normalisation support
ngodber opened this issue · comments
When moving from stream to quiver I ran into the issue where I am unable to normalise the vector magnitudes. As a consequence given the scale of values almost all arrows are dots on the screen. It would be good to specify normalisation for both vector magnitude and colour range of mesh.
Have you tried passing options on to quiver
via quiver_opts
? It’s actually fairly difficult to get good default values here for the wide range of values we plot, so see if you can get something reasonable with those.
Yeah I tried quiver_opts. The closest candidate is scale, however that is simply a linear multiplier. All solutions around the web rely on modifying U and V before plot. Not a problem normally, but as plot_image accepts the vector there is no way to do that without manually calling a quiver plot. AFAIK, the norm argument would do the trick here and do so quite elegantly. If quiver_opts contains a norm then after calling the poly collection, we'd only need to call norm for U and V (retaining the sign) before calling quiver, norm function simply returns a value between 0 and 1 between vmin and vmax. Quiver itself seems to apply norm to mapping the colour of the arrows themselves, but has no equivalent support for the vector magnitude. Alternatively allow users to define a custom norm function which accepts U and V and returns the normed values. As quiver itself doesnt support sophisticated norms I think it'll be a pretty significant pain point down the road.