ADR 0007: Do not support arguments referring to x or y
ADR 0007: Do not support arguments referring to
Deciders: Jan-Lukas, Neil, Owen, Simon
Particularly in Scipp’s plotting functionality there can be confusion from different interpretation of
'y'of the data being handled (plotted).
yaxes of a (matplotlib) figure, e.g., as referenced by the
ylimargs matplotlib provides.
The meaning of above
yand the configured limits after the “transpose” button in the plot was activated.
Furthermore it should be considered that Scipp supports dimensions in arbitrary order.
That is, data depending on
dim1 may be stored as
[dim0, dim1] or as
Creating a plot from this with hypothetical
xmin arguments to
plot() would thus yield different and unpredictable results depending on an, in principle, irrelevant detail of the data.
The ambiguity can be avoided using Scipp’s ubiquitous approach of requiring explicit dimension labels.
One example for this is the
scale argument of
plot(), which is a dictionary mapping from dimension labels to the desired scale (linear or logarithmic).
The same approach should be adopted for all other arguments to
Note that in the case of defining limits, an alternative approach recommended to users is the use of slicing.
Do not provide or support arguments referring to
Self documenting syntax.
Avoid unpredictable resulting plots if dimension order changes.
xlimor other arguments with names identical to matplotlib syntax increases the learning effort.
Marginally more typing.