class eelbrain.plot.Barplot(y, x=None, match=None, sub=None, cells=None, test=True, tail=0, par=True, corr='Hochberg', trend=False, test_markers=True, ylabel=True, error='sem', pool_error=None, ec='k', xlabel=True, xticks=True, xtick_delim='\\n', colors=False, bottom=None, top=None, origin=None, pos=None, width=0.5, c='#0099FF', edgec=None, ds=None, **kwargs)

Barplot for a continuous variable

  • y (Var) – Dependent variable.

  • x (categorial) – Model (Factor or Interaction).

  • match (None | categorial) – Match cases for a repeated measures design.

  • sub (index-array) – Use a subset of the data.

  • cells (None | sequence of cells of x) – 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.

  • 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).

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

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

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

  • ylabel (str | None) – Y axis label (default is inferred from the data).

  • error (str) – Measure of variability to plot. Examples: sem: Standard error of the mean; 2sem: 2 standard error of the mean; ci: 95% confidence interval; 99%ci: 99% confidence interval.

  • pool_error (bool) – Pool the errors for the estimate of variability (default is True for related measures designs, False for others). See Loftus & Masson (1994).

  • ec (matplotlib color) – Error bar color.

  • xlabel (str | bool) – X axis label (default is

  • xticks (None | sequence of str | dict) – 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).

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

  • bottom (scalar) – Lower end of the y axis (default is determined from the data).

  • top (scalar) – Upper end of the y axis (default is determined from the data).

  • origin (scalar) – Origin of the bars on the y-axis (the default is 0, or the visible point closest to it).

  • pos (sequence of scalar) – Position of the bars on the x-axis (default is range(n_cells)).

  • width (scalar or sequence of scalar) – Width of the bars (deault 0.5).

  • c (matplotlib color) – Bar color (ignored if colors is specified).

  • edgec (matplotlib color) – Barplot edge color.

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

  • .. – Also accepts General layout parameters.


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 the figure.


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


Draw crosshairs under the cursor


image([name, format, close])

Create FMTXT Image from the figure

save(*args, **kwargs)

Short-cut for Matplotlib’s savefig()


Set the figure window title

set_xlabel(label[, ax])

Set the label for the x-axis


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