win_stay_lose_switch_plot#
- win_stay_lose_switch_plot(df: DataFrame, hue: str = None, ax: Axes = None, trajectory: bool = False, palette=None, legend: bool = True, corners: bool = True) Axes[source]#
Win-stay (y) against lose-switch (x) probabilities, in a square from 0 to 1: a point per row of df (from metrics.choices.get_win_stay_lose_switch_df), e.g. one per session, per mouse or per group of trials. Chance (0.5) is marked with dashed lines; a mouse that follows the win-stay / lose-switch strategy is on the top right.
- Parameters:
df – win_stay and lose_switch of each group (rows with NaN are left out).
hue – the column that colors the points (“session”, “subject”…), with a legend. More than 10 groups (e.g. days) go from dark to yellow, and the legend shows the first and the last. None: one color.
trajectory – join the points in the order of hue (e.g. “trial_group”, through training), from dark (start) to yellow (end), as one line.
palette – colors of the points (a list, or a dict {value of hue: color}, e.g. a fixed color per mouse), or the colormap of the trajectory (default: the group colours and the sequential colormap of the style, see style.py).
legend – show the legend of hue.
corners – write the strategy of each corner.