PlotDimsMixin

class PlasmaCalcs.plotting.plot_tools.plot_dims.PlotDimsMixin

Bases: object

mixin for plotting classes, to manage PlotDimsInferrer.

Note that “dims” is a bit of a misnomer, it can refer to coordinates as well,
especially in the case of using 2D coords for x and/or y axes.
Expects subclass to do the following (before ever utilizing plot_dims)
- assign plot_dims_inputs dict
- assign PLOT_DIMS_EXPECTING if desired
(else, it will default to UNSET, i.e. all plot_dims_inputs must be specified.)
plot_dims will be initialized (when first accessed) as:
PlotDimsInferrer(**plot_dims_inputs, expecting=self.PLOT_DIMS_EXPECTING)
Note that plotting codes will probably want to determine plot dims/coords via
self.plot_dims.x_coord, y_coord, t_coord, row_coord, col_coord, others_coords,
assuming array was processed like:
array = self.plot_dims.fill_coords(array)
array = self.plot_dims.promote_dims(array)
Probably avoid using self.plot_dims.x_dims, y_dims, t_dim, row_dim, col_dim, others_dims,
because 1D coords will have been promoted in the array itself,
but still known as “coords” in self.plot_dims.
(Meanwhile 2D x and y can be single strings for x_coord and y_coord,
while x_dims and y_dims will each be lists.)

Methods

_make_plot_dims()

returns plot_dims from plot_dims_inputs and PLOT_DIMS_EXPECTING.

Attributes

PLOT_DIMS_EXPECTING

plot_dims

PlotDimsInferrer for this plotting object.

plot_dims_inputs

inputs for creating self.plot_dims.

_make_plot_dims()

returns plot_dims from plot_dims_inputs and PLOT_DIMS_EXPECTING.

property plot_dims

PlotDimsInferrer for this plotting object.

Created from plot_dims_inputs and PLOT_DIMS_EXPECTING.
See help(self.plot_dims_inferrer_cls) for more details.
plot_dims_inferrer_cls

alias of PlotDimsInferrer

property plot_dims_inputs

inputs for creating self.plot_dims.

(Internally actually uses PlotDimsInferrer._translate_inputs(plot_dims_inputs);
provide _skip_translation=True to skip the normal translation rules.)