xarray_title_plot_node

PlasmaCalcs.plotting.labels.xarray_title_plot_node(array, base_text=UNSET, t=None, *, ax=None, parent=None, **kw)

create a MoviePlotNode for a title associated with an xarray.DataArray.

array: xarray.DataArray, probably ndim=3.

the full DataArray which will be plotted throughout the movie.
internally, store xarray_fill_coords(array), so that coordless dims’ indices can be used.
e.g. if “dim0” is a dimension with no coords, will use np.arange(dim0.size).
base_text: UNSET or str
the base text string, to be formatted by array at each frame.
UNSET –> will use array._title_for_slice() for array at each frame.
str –> will be formatted by xarray_nondim_coords(array at frame).
E.g., base_text=’fluid={{fluid}}, time={{t:.2e}} seconds’.
t: None or str
the array dimension which frames will index. E.g. ‘time’.
None –> infer it from array coords.
parent: None or MoviePlotNode
if provided, the parent of this node. None -> this node has no parent.
title_font: UNSET, None, or str (default: UNSET)
font for title, e.g. ‘serif’, ‘sans-serif’, or ‘monospace’
UNSET –> use DEFAULTS.PLOT.MOVIE_TITLE_FONT (default: monospace).
None –> use matplotlib default.
title_y: UNSET, None, or number (default: UNSET)
y position for title, in axes coordinates.
title_kw: UNSET, or dict (default: UNSET)
any additional kwargs for plt.title.
text_kw: UNSET, None, or dict (default: UNSET)
any additional kwargs for text, e.g. text_kw=dict(fontweight=bold).
Applied to titles too, but individual kw can be overridden by title settings.
[TODO] ability to enter unambiguous text_kw directly, e.g. fontweight.
Additional kwargs go directly to plt.title()