Extend `poloidal_plot` option in `animate_list()` to support polygon plotting.
Mike Kryjak improved the poloidal plotting in https://github.com/boutproject/xBOUT/pull/280, by introducing a function
https://github.com/boutproject/xBOUT/blob/64408ea26de5751f6104fcd8598ab250e237b049/xbout/plotting/plotfuncs.py#L852-L872
, so that unphysical artefacts of plotting do not appear. This feature has not been extended to support animate_list, used in examples in Hermes-3, e.g.,
ds.bout.animate_list(
["Nd"],
poloidal_plot=True,
show=True,
save_as="hermes_animation",
)
This appears to affect nonorthogonal grids particularly badly. The figures below are generated from two simulations of neutral diffusion on orthogonal and nonorthogonal grids for the same physics case.
Orthogonal output:
Nonorthogonal output showing fictitious artefacts:
Further notes:
It looks like the function that requires upgrading is https://github.com/boutproject/xBOUT/blob/64408ea26de5751f6104fcd8598ab250e237b049/xbout/plotting/animate.py#L93, with changes to lines https://github.com/boutproject/xBOUT/blob/64408ea26de5751f6104fcd8598ab250e237b049/xbout/plotting/animate.py#L263-L271 needed to replace Pcolormesh.
Unfortunately it looks like animatplot does not support a plot option like plot2d_polygon, i.e., it is not clear if we can supply a list of frames make by a homemade plotting function to the animator. https://animatplot.readthedocs.io/en/stable/api.html.