xbout.plotting.animate.animate_poloidal#
- xbout.plotting.animate.animate_poloidal(da, *, ax=None, cax=None, animate_over=None, separatrix=True, targets=True, add_limiter_hatching=True, cmap=None, axis_coords=None, vmin=None, vmax=None, logscale=False, animate=True, save_as=None, fps=10, controls='both', aspect=None, extend=None, **kwargs)[source]#
Make a 2D plot in R-Z coordinates using animatplotlib’s Pcolormesh, taking into account branch cuts (X-points).
- Parameters:
da (
xarray.DataArray
) – A 2D (x,y) DataArray of data to plotax (
Axes
, optional) – A matplotlib axes instance to plot to. If None, create a new figure and axes, and plot to thatcax (
Axes
, optional) – Matplotlib axes instance where the colorbar will be plotted. If None, the default position created by matplotlab.figure.Figure.colorbar() will be used.animate_over (
str
, optional) – Dimension over which to animate, defaults to the time dimensionseparatrix (
bool
, optional) – Add dashed lines showing separatricestargets (
bool
, optional) – Draw solid lines at the target surfacesadd_limiter_hatching (
bool
, optional) – Draw hatched areas at the targetscmap (
matplotlib.colors.Colormap instance
, optional) – Colors to use for the plotaxis_coords (
None
,str
,dict
) –Coordinates to use for axis labelling. Only affects time coordinate.
None: Use the dimension coordinate for each axis, if it exists.
”index”: Use the integer index values.
dict: keys are dimension names, values set axis_coords for each axis separately. Values can be: None, “index”, the name of a 1d variable or coordinate (which must have the dimension given by ‘key’), or a 1d numpy array, dask array or DataArray whose length matches the length of the dimension given by ‘key’.
vmin (
float
, optional) – Minimum value for the color scalevmax (
float
, optional) – Maximum value for the color scalelogscale (
bool
orfloat
, optional) – If True, default to a logarithmic color scale instead of a linear one. If a non-bool type is passed it is treated as a float used to set the linear threshold of a symmetric logarithmic scale as linthresh=min(abs(vmin),abs(vmax))*logscale, defaults to 1e-5 if True is passed.animate (
bool
, optional) – If set to false, do not create the animation, just return the blockssave_as (
True
orstr
, optional) – If str is passed, save the animation as save_as+’.gif’. If True is passed, save the animation with a default name, ‘<variable name>_over_<animate_over>.gif’fps (
float
, optional) – Frame rate for the animationcontrols (
string
orNone
, default"both"
) – By default, add both the timeline and play/pause toggle to the animation. If “timeline” is passed add only the timeline, if “toggle” is passed add only the play/pause toggle. If None or an empty string is passed, add neither.aspect (
str
orNone
, optional) – Argument to set_aspect(), defaults to “equal”**kwargs (optional) – Additional arguments are passed on to the animation method animatplot.blocks.Pcolormesh
- Returns:
If animate==True, returns an animatplot.Animation object, otherwise returns a list of animatplot.blocks.Pcolormesh instances.
- Return type:
animation
orblocks