eelbrain.plot.Timeplot
- class eelbrain.plot.Timeplot(y, time, categories=None, match=None, sub=None, data=None, main=<function mean>, error='sem', x_jitter=False, bottom=None, top=None, xlabel=True, ylabel=True, timelabels=None, legend=None, labels=None, colors=None, **kwargs)
Plot a variable over time
- Parameters
time (Union[Var, str, Factor, Interaction, NestedEffect]) – Variable assigning the time to each case.
categories (Union[Factor, Interaction, NestedEffect, str]) – Plot
y
separately for different categories.match (Union[Factor, Interaction, NestedEffect, str]) – Match cases for a repeated measures design.
data (Dataset) – If a Dataset is specified, all data-objects can be specified as names of Dataset variables
main (numpy function) – draw lines to connect values across time (default: np.mean). Can be ‘bar’ for barplots or False.
error (str) – How to indicate estimate error. For complete within-subject designs, the within-subject measures are displayed (see Loftus & Masson, 1994). Options: ‘box’: boxplots; ‘[x]sem’: x standard error of the means (e.g. ‘sem’, ‘2sem’); ‘[x]std’: x standard deviations.
x_jitter (bool) – When plotting error bars, jitter their location on the x-axis to increase readability.
bottom (scalar) – Lower end of the y axis (default is 0).
top (scalar) – Upper end of the y axis (default is determined from 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.
timelabels (sequence | dict | 'all') – Labels for the x (time) axis. Exact labels can be specified in the form of a list of labels corresponsing to all unique values of
time
, or a{time_value: label}
dictionary. For ‘all’, all values oftime
are marked. The default is normal matplotlib ticks.legend (str | int | 'fig' | None) – Matplotlib figure legend location argument or ‘fig’ to plot the legend in a separate figure.
labels (dict) – Alternative labels for legend as
{cell: label}
dictionary (preserves order).colors (str | list | dict) – Colors for the categories. str: A colormap name; cells are mapped onto the colormap in regular intervals. list: A list of colors in the same sequence as the cells. dict: A dictionary mapping each cell to a color. Colors are specified as matplotlib compatible color arguments.
... – 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 |
|
Plot the legend (or remove it from the figure). |
|
Short-cut for Matplotlib's |
|
Save the legend as image file |
|
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 |