mpl#

Matplotlib figure-generating functions

Functions

plot_2d_response_map(campaign, row_params, ...)

Plot a hierarchical 2D response map for a fitted campaign.

plot_interactions(optimizer, cor[, clamp])

Plots the parameter interaction matrix

plot_ofat_ranges(optimizer, ofat_ranges)

Plots each parameter's 1D OFAT acceptable range

obsidian.plotting.mpl.plot_2d_response_map(campaign: Campaign, row_params: dict[str, list], col_params: dict[str, list], *, fixed_params: dict[str, float | str] | None = None, mode: str = 'passfail', value: str = 'mean', target_names: list[str] | None = None, target_display_names: dict[str, str] | None = None, param_display_names: dict[str, str] | None = None, PI_range: float | None = None, confidence_level: str | None = None, include_joint: bool = True, cmap=None, fail_color: str | None = None, pass_color: str | None = None, fail_alpha: float = 1.0, pass_alpha: float = 1.0, confidence_cmap: list[str] | None = None, fig_width: float = 5.0) tuple[Figure, ndarray][source]#

Plot a hierarchical 2D response map for a fitted campaign.

Each cell is one GP prediction at a single point in parameter space. Row and column hierarchies (each potentially several nested levels deep) are constructed from the Cartesian product of row_params and col_params. Every parameter in the campaign must appear in exactly one of row_params, col_params, or fixed_params (parameters held constant don’t appear as labels). Works for both characterization and plain optimization campaigns.

Parameters:
  • campaign – Fitted campaign (any task).

  • row_params{name: [v1, v2, ...]}. First key is innermost (closest to the cells); last key is outermost.

  • col_params{name: [v1, v2, ...]}. Same convention as row_params.

  • fixed_params – Parameters held constant. Numeric or categorical values OK. Required for any campaign parameter not in row_params / col_params.

  • mode

    One of:

    • "passfail" – binary pass/fail per target (and optional joint column). Uses confidence_level / PI_range to control how strict the pass/fail decision is. Requires thresholds.

    • "confidence" – 4-level confidence per target (and optional joint = elementwise min). Levels: 0 fail, 1 uncertain pass, 2 likely pass, 3 confident pass. Requires thresholds.

    • "continuous" – continuous colormap of the mean prediction (or std, if value="std"). Requires exactly one target; thresholds are not used.

  • value – Continuous-mode quantity to plot. "mean" (default) plots the predictive mean; "std" plots the predictive standard deviation. Ignored for non-continuous modes.

  • target_names – Subset of campaign targets to plot. Default: all relevant.

  • target_display_names – Pretty names for panel titles.

  • param_display_names – Pretty names for parameters in the row/col gutters.

  • PI_range – Prediction-interval coverage (passfail mode only; 0.7 or 0.95).

  • confidence_level – Passfail-mode override for PI: None, "mean", "70%", or "95%".

  • include_joint – Add a joint panel (passfail/confidence multi-target).

  • cmap – Colormap for mode="continuous". Default obsidian_viridis.

  • fail_color – Passfail-mode colors. Defaults: Obsidian branding magenta (fail) / teal (pass).

  • pass_color – Passfail-mode colors. Defaults: Obsidian branding magenta (fail) / teal (pass).

  • fail_alpha – Passfail-mode alphas.

  • pass_alpha – Passfail-mode alphas.

  • confidence_cmap – 4 hex colors for confidence mode.

  • fig_width – Figure width per panel band, in inches.

Returns:

(fig, axes). axes has shape (1, n_panels).

obsidian.plotting.mpl.plot_interactions(optimizer: Optimizer, cor: ndarray, clamp: bool = False)[source]#

Plots the parameter interaction matrix

Parameters:
  • optimizer (ptimizer) – The optimizer object which contains a surrogate that has been fit to data and can be used to make predictions.

  • cor (np.ndarray) – The correlation matrix representing the parameter interactions.

  • clamp (bool, optional) – Whether to clamp the colorbar range to (0, 1). Defaults to False.

Returns:

The parameter interaction plot

Return type:

Figure

obsidian.plotting.mpl.plot_ofat_ranges(optimizer: Optimizer, ofat_ranges: DataFrame) Figure[source]#

Plots each parameter’s 1D OFAT acceptable range

Parameters:
  • optimizer (Optimizer) – The optimizer object which contains a surrogate that has been fit to data and can be used to make predictions.

  • ofat_ranges (pd.DataFrame) – A DataFrame containing the acceptable range values for each parameter, at the low bound, average, and high bound.

Returns:

The parameter OFAT acceptable-range plot

Return type:

Figure