sdf_xarray.plotting.animate_multiple#
- sdf_xarray.plotting.animate_multiple(*datasets, datasets_kwargs=None, fps=10, min_percentile=0, max_percentile=100, title=None, display_sdf_name=False, move_window=False, t=None, ax=None, **common_kwargs)[source]#
Generate an animation using multiple
xarray.DataArray. The intended use of this function is viasdf_xarray.dataset_accessor.EpochAccessor.animate_multiple.- Parameters:
datasets (
DataArray) –xarray.DataArrayobjects containing the data to be animateddatasets_kwargs (
list[dict[str,Any]] |None) –- A list of dictionaries, following the same order as
datasets, containing per-dataset matplotlib keyword arguments. The list does not need to be the same length as
datasets; missing entries are initialised as empty dictionaries
- A list of dictionaries, following the same order as
fps (
float) – Frames per second for the animationmin_percentile (
float) – Minimum percentile of the datamax_percentile (
float) – Maximum percentile of the datadisplay_sdf_name (
bool) – Display the sdf file name in the animation titlemove_window (
bool) – Update thexlimto be only values that are not NaNs at each time intervalt (
str|None) – Coordinate for t axis (the coordinate which will be animated over). IfNone, usedata.dims[0]common_kwargs – Matplotlib keyword arguments applied to all datasets. These are overridden by per-dataset entries in
datasets_kwargs
- Return type:
Examples
>>> anim = animate_multiple( ds["Derived_Number_Density_Electron"], ds["Derived_Number_Density_Ion"], datasets_kwargs=[{"label": "Electron"}, {"label": "Ion"}], ylim=(0e27,4e27), display_sdf_name=True, ylabel="Derived Number Density [1/m$^3$]" ) >>> anim.save("animation.gif")