eelbrain.plot.Boxplot

class eelbrain.plot.Boxplot(y, x=None, match=None, sub=None, cells=None, bottom=None, top=None, xlabel=True, ylabel=True, xticks=True, xtick_delim='\\n', test=True, tail=0, par=True, trend=False, test_markers=True, corr='Hochberg', colors=False, ds=None, label_fliers=False, **kwargs)

Boxplot for a continuous variable

Parameters
  • y (Union[Var, str]) – Dependent variable.

  • x (Union[Factor, Interaction, NestedEffect, str, None]) – Category definition (draw one box for every cell in x).

  • match (Union[Factor, Interaction, NestedEffect, str, None]) – Match cases for a repeated measures design.

  • sub (Union[Var, ndarray, str, None]) – Use a subset of the data.

  • cells (Optional[Sequence[Union[str, Tuple[str, …]]]]) – Cells to plot (optional). All entries have to be cells of x). Can be used to change the order of the bars or plot only certain cells.

  • bottom (Optional[float]) – Lowest possible value on the y axis (default is 0 or slightly below the lowest value).

  • top (Optional[float]) – Set the upper x axis limit (default is to fit all the data).

  • xlabel (Union[bool, str]) – X-axis label. By default the label is inferred from the data.

  • ylabel (Union[bool, str]) – Y-axis label. By default the label is inferred from the data.

  • xticks (Union[bool, dict, Sequence[str]]) – X-axis tick labels describing the categories. The default is to use the cell names from x. Use list of labels or {cell: label} dict for custom labels. None to plot no labels.

  • xtick_delim (str) – Delimiter for x axis category descriptors (default is '\n', i.e. the level on each Factor of x on a separate line).

  • test (bool | scalar) – True (default): perform pairwise tests; False: no tests; scalar: 1-sample tests against this value.

  • tail (0 | 1 | -1) – Tailedness of the test (when testing against population mean).

  • par (bool) – Use parametric test for pairwise comparisons (use non-parametric tests if False).

  • trend (str) – Marker for a trend in pairwise comparisons.

  • test_markers (bool) – For pairwise tests, plot markers indicating significance level (stars).

  • corr (None | 'hochberg' | 'bonferroni' | 'holm') – Method for multiple comparison correction (default ‘hochberg’).

  • colors (bool | sequence | dict of matplitlib colors) – Matplotlib colors to use for boxes (True to use the module default; default is False, i.e. no colors).

  • ds (Dataset) – If a Dataset is specified, all data-objects can be specified as names of Dataset variables

  • label_fliers (bool) – Add labels to flier points (outliers); requires match to be specified.

  • .. – Also accepts General layout parameters and boxplot() parameters.

Methods

add_hline(y[, axes])

Draw a horizontal line on one or more axes

add_hspan(bottom, top[, axes])

Draw a horizontal bar on one or more axes

add_vline(x[, axes])

Draw a vertical line on one or more axes

add_vspan(xmin, xmax[, axes])

Draw a vertical bar on one or more axes

close()

Close the figure.

draw()

(Re-)draw the figure (after making manual changes).

draw_crosshairs([enable])

Draw crosshairs under the cursor

get_ylim()

image([name, format, close])

Create FMTXT Image from the figure

save(*args, **kwargs)

Short-cut for Matplotlib’s savefig()

set_name(name)

Set the figure window title

set_xlabel(label[, ax])

Set the label for the x-axis

set_xtick_rotation(rotation)

Rotate every x-axis tick-label by an angle (counterclockwise, in degrees)

set_ylabel(label[, ax])

Set the label for the y-axis

set_ylim([bottom, top])

Set the y-axis limits