Create a ggplot aesthetic mapping from a BehaviorSpace experiment object, based on chosen x-variable, y-variable, and optional grouping variable. Optionally, include a mapping for error bars or an error ribbon.

get_plot_mapping(experiment, plot_data, x_var, y_var, group_var, error_bars)

Arguments

experiment

A BehaviorSpace experiment object, as returned from load_bs_file(), load_bs_table(), or load_bs_spreadsheet().

plot_data

Plot data returned from get_plot_data().

x_var

The name of an x-variable for the plot.

y_var

The name of an x-variable for the plot.

group_var

The name of an x-variable for the plot.

error_bars

The kind of error bars to use. Legal values are "none", "error bars", or "bands"

Value

A named list with an aesthetic mapping, A label specification for the axes, and a legend specification.