eelbrain.plot.Correlation¶
-
class
eelbrain.plot.
Correlation
(y, x, cat=None, sub=None, ds=None, c=['b', 'r', 'k', 'c', 'm', 'y', 'g'], legend='upper right', labels=None, xlabel=True, ylabel=True, *args, **kwargs)¶ Plot the correlation between two variables
Parameters: - y : Var
Variable for the y-axis.
- x : Var
Variable for the x-axis.
- cat : categorial
Plot the correlation separately for different categories.
- sub : None | index-array
Use a subset of the data.
- ds : None | Dataset
If a Dataset is specified, all data-objects can be specified as names of Dataset variables
- c : list
List of colors for cells.
- 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).- xlabel, ylabel : str
Label for the x- and y-axis (default based on data).
- tight : bool
Use matplotlib’s tight_layout to expand all axes to fill the figure (default True)
- …
Also accepts General layout parameters.
Methods¶
add_hline (self, y[, axes]) |
Draw a horizontal line on one or more axes |
add_hspan (self, bottom, top[, axes]) |
Draw a horizontal bar on one or more axes |
add_vline (self, x[, axes]) |
Draw a vertical line on one or more axes |
add_vspan (self, xmin, xmax[, axes]) |
Draw a vertical bar on one or more axes |
close (self) |
Close the figure. |
draw (self) |
(Re-)draw the figure (after making manual changes). |
draw_crosshairs (self[, enable]) |
Draw crosshairs under the cursor |
image (self[, name, format]) |
Create FMTXT Image from the figure |
plot_legend (self[, loc, labels]) |
Plot the legend (or remove it from the figure). |
save (self, *args, **kwargs) |
Short-cut for Matplotlib’s savefig() |
save_legend (self, *args, **kwargs) |
Save the legend as image file |
set_name (self, name) |
Set the figure window title |
set_xlabel (self, label[, ax]) |
Set the label for the x-axis |
set_xtick_rotation (self, rotation) |
Rotate every x-axis tick-label by an angle (counterclockwise, in degrees) |
set_ylabel (self, label[, ax]) |
Set the label for the y-axis |