Plot an Experiment#

xynergy.plot.plot_response_landscape(df: DataFrame, dose_cols: list[str] = ['dose_a', 'dose_b'], response_col: str = 'response', reference_col=None, color_min=None, color_mid=None, color_max=None, scheme='viridis', response_label='Response')#

Plot a single experiment.

Parameters#

df: polars.DataFrame

Contains, minimally, one response and two agent dose per row.

dose_cols: list, default [“dose_a”, “dose_b”]

A list of exactly two columns names that contain numeric values of agent dose

response_col: string, default “response”

The name of the column containing responses

reference_col: string, optional

Column to subtract from response_col

color_min: float, optional

Value to set as the lower range for the color scale. If unspecified, defaults to 0 if reference_col is None, otherwise will default to minimum value plotted

color_mid: float, optional

Value to set as the middle of the range for the color scale.

If unspecified:

  • If reference_col is None, will be the average of color_min and color_max

  • If reference_col is not None:
    • Will be 0 if that is within the bounds of the plotted values

    • Otherwise, will be average of color_min and color_max

color_max: float, optional

Value to set as the upper range for the color scale. If unspecified, defaults to 100 if reference_col is None, otherwise will default to maximum value plotted

scheme: string, default “viridis”

Color scheme for response colors. For a list of available schemes, see: https://vega.github.io/vega/docs/schemes/

response_label: string, default “Response”

What to label the color scale

Returns#

An altair.Chart with the first dose column on the X-axis, the second dose column on the Y-axis, and a colored grid of squares corresponding to the response (optionally minus the reference)

Notes#

Replicates with same dosepair concentrations will have their response’s mean taken before ploting