aepsych.plotting module

aepsych.plotting.plot_strat(strat, ax=None, true_testfun=None, cred_level=0.95, target_level=0.75, xlabel=None, ylabel=None, yes_label='Yes trial', no_label='No trial', flipx=False, logx=False, gridsize=30, title='', save_path=None, show=True, include_legend=True, include_colorbar=True)[source]

Creates a plot of a strategy, showing participants responses on each trial, the estimated response function and threshold, and optionally a ground truth response threshold.

  • strat (Strategy) – Strategy object to be plotted. Must have a dimensionality of 2 or less.

  • ax (plt.Axes, optional) – Matplotlib axis to plot on (if None, creates a new axis). Default: None.

  • true_testfun (Callable, optional) – Ground truth response function. Should take a n_samples x n_parameters tensor as input and produce the response probability at each sample as output. Default: None.

  • cred_level (float) – Percentage of posterior mass around the mean to be shaded. Default: 0.95.

  • target_level (float) – Response probability to estimate the threshold of. Default: 0.75.

  • xlabel (str) – Label of the x-axis. Default: “Context (abstract)”.

  • ylabel (str) – Label of the y-axis (if None, defaults to “Response Probability” for 1-d plots or “Intensity (Abstract)” for 2-d plots). Default: None.

  • yes_label (str) – Label of trials with response of 1. Default: “Yes trial”.

  • no_label (str) – Label of trials with response of 0. Default: “No trial”.

  • flipx (bool) –

    Whether the values of the x-axis should be flipped such that the min becomes the max and vice


    (Only valid for 2-d plots.) Default: False.

  • logx (bool) – Whether the x-axis should be log-transformed. (Only valid for 2-d plots.) Default: False.

  • gridsize (int) – The number of points to sample each dimension at. Default: 30.

  • title (str) – Title of the plot. Default: ‘’.

  • save_path (str, optional) – File name to save the plot to. Default: None.

  • show (bool) – Whether the plot should be shown in an interactive window. Default: True.

  • include_legend (bool) – Whether to include the legend in the figure. Default: True.

  • include_colorbar (bool) – Whether to include the colorbar indicating the probability of “Yes” trials. Default: True.

Return type