XarrayLinePlotElement

class PlasmaCalcs.plotting.lines.XarrayLinePlotElement(array, *, ax=None, aspect=None, **kw_super)

Bases: MoviePlotElement

plot line of 1D data.

array: xarray.DataArray, probably ndim=1.
the data to be plotted.
coords with ndim>0, dtype=object will be converted to strings suitable for ticklabels.
label: UNSET or str (default: UNSET)
label for this plot element, to be included in a legend.
For xarrays, will label.format(**xarray_nondim_coords(array)).
To view or adjust plot settings in self, see self.plot_settings, or help(self.plot_settings).

Methods

__init_subclass__(*args_super, **kw)

appends note about using self.plot_settings, to cls.__doc__.

init_line()

initialize the line plot; actually plot the data.

update_data(data)

update the plot using data['array'].

Attributes

array

array for plot.

ax

the axes containing this line plot

fig

figure containing this line plot

line

line plot (instance of matplotlib.lines.Line2D)

classmethod __init_subclass__(*args_super, **kw)

appends note about using self.plot_settings, to cls.__doc__.

if “PlotSettings” or “plot_settings” appears in cls.__doc__, do NOT append this note;
assuming instead that this means the doc already mentions how to use plot_settings.
property array

array for plot. Internally, stored at self.data[‘array’]

property ax

the axes containing this line plot

property fig

figure containing this line plot

init_line()

initialize the line plot; actually plot the data.

stores plotted object in self.line and returns self.line.
property line

line plot (instance of matplotlib.lines.Line2D)

update_data(data)

update the plot using data[‘array’].

return the list of all updated matplotlib Artist objects (i.e., [self.line])