eelbrain.plot.Barplot
- class eelbrain.plot.Barplot(y, x=None, match=None, sub=None, cells=None, error='sem', within_subject_error=None, ec='k', test=True, tail=0, par=True, corr='Hochberg', trend=False, test_markers=True, bottom=None, top=None, origin=None, xlabel=True, ylabel=True, labels=None, xticks=True, xtick_delim='\n', xtick_rotation=None, colors=False, pos=None, width=0.5, color='#0099FF', edgec=None, data=None, **kwargs)
Barplot for a continuous variable
- Parameters:
x (Factor | Interaction | NestedEffect | str) – Model (Factor or Interaction).
match (Factor | Interaction | NestedEffect | str) – Match cases for a repeated measures design.
cells (Sequence[str | Tuple[str, ...]]) – Cells to plot. All entries have to be cells of
x
. Use to change the order of the bars or plot bars for only a subset of 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.within_subject_error (bool) – Within-subject error bars (see Loftus & Masson, 1994; default is
True
for complete related measures designs,False
otherwise).ec (matplotlib color) – Error bar color.
test (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 (bool | Literal['hochberg', 'bonferroni', 'holm']) – Method for multiple comparison correction (default ‘hochberg’).
trend (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; for adjusting the bottom of the bars see the
origin
argument).top (float) – Upper end of the y axis (default is determined from the data).
origin (float) – Origin of the bars on the y-axis (the default is
0
, or the visible point closest to it).ylabel (bool | str) – Y axis label (default is inferred from the data).
labels (Dict[str | Tuple[str, ...], str]) – Labels for cells as
{cell: label}
dictionary.xticks (bool | Dict[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 toFalse
to plot no labels.xtick_delim (str) – Delimiter for x axis category descriptors (default is
'\n'
, i.e. the level on each Factor ofx
on a separate line).xtick_rotation (float | str) – Tick label orientation –
'vertical'
'horizontal'
or an angle.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 (Sequence[float]) – Position of the bars on the x-axis (default is
range(n_cells)
).width (float | Sequence[float]) – Width of the bars (deault 0.5).
color (Any) – Bar color (ignored if
colors
is specified).edgec (matplotlib color) – Barplot edge color.
data (Dataset) – If a Dataset is specified, all data-objects can be specified as names of Dataset variables
... – Also accepts General layout parameters.
Methods
|
Draw a horizontal line on one or more axes |
|
Draw a horizontal bar on one or more axes |
|
Draw a vertical line on one or more 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 |
|
Draw the outline of the figure |
|
|
|
Create FMTXT Image from the figure |
|
Mark a pair of categories with a line and a label |
|
Short-cut for Matplotlib's |
|
Set the figure window title |
|
Set the label for the x-axis |
|
Rotate every x-axis tick-label by an angle (counterclockwise, in degrees) |
|
Set the label for the y-axis |
|
Set the y-axis limits |