eelbrain.plot.BarplotHorizontal

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

Horizontal barplot for a continuous variable

For consistency with plot.Barplot, y refers to the horizontal axis and x refers to the vertical (categorial) axis.

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

  • x (Union[Factor, Interaction, NestedEffect, str, None]) – Model (Factor or Interaction).

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

  • 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 (Optional[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.

  • test (Union[bool, float]) – True (default): perform pairwise tests; False: no tests; scalar: 1-sample tests against this value.

  • tail (Literal[-1, 0, 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 (Union[bool, Literal[‘hochberg’, ‘bonferroni’, ‘holm’]]) – Method for multiple comparison correction (default ‘hochberg’).

  • trend (Union[bool, str]) – Marker for a trend in pairwise comparisons.

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

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

  • top (Optional[float]) – Upper end of the y axis (default is determined from the data).

  • origin (Optional[float]) – Origin of the bars on the data axis (the default is 0).

  • xlabel (Union[bool, str]) – X axis label (default is x.name).

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

  • labels (Optional[Dict[Union[str, Tuple[str, ...]], str]]) – Labels for cells as {cell: label} dictionary.

  • xticks (Union[bool, Dict[Union[str, Tuple[str, ...]], str], Sequence[str]]) – X-axis tick labels. The default is to use the cell names from x. Can be specified as list of labels or as {cell: label} dict, or set to False to plot no labels.

  • xtick_delim (str) – Delimiter for x axis category descriptors.

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

  • pos (Optional[Sequence[float]]) – Position of the bars on the x-axis (default is range(n_cells)).

  • width (Union[float, Sequence[float]]) – Width of the bars (deault 0.5).

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

  • edgec (matplotlib color) – Barplot edge color.

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

  • ... – Also accepts General layout 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

add_vspans(intervals[, axes])

Draw vertical bars over axes

close()

Close the figure.

draw()

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

draw_crosshairs([enable])

Draw crosshairs under the cursor

draw_outline([color])

Draw the outline of the figure

get_xlim()

image([name, format, close])

Create FMTXT Image from the figure

mark_pair(cell_1, cell_2, y[, dy, mark, ...])

Mark a pair of categories with a line and a label

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_xlim([left, right])

Set the x-axis limits for all axes

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