pystra.plotting.plot_limit_state#

plot_limit_state(limit_state, *, bounds, surrogate=None, density=None, density_levels=None, n_points=151, batch_size=2048, labels=('$x_1$', '$x_2$'), shade_failure=True, ax=None)[source]#

Plot a two-dimensional limit-state boundary and optional surrogate.

Parameters:
  • limit_state (Callable) – Receives row-wise points of shape (n, 2); returns shape (n,). Failure is g <= 0. The plot evaluates n_points**2 true-model points; this is additional plotting cost, outside analysis evaluation counts.

  • bounds (Sequence[Sequence[float]]) – Increasing (lower, upper) bounds for each coordinate, in its own units.

  • surrogate (Surrogate | None) – Fitted surrogate in exactly the same coordinates as limit_state. PySTRA active-learning surrogates require independent normal coordinates; map the true model accordingly before supplying it here.

  • density (Callable | None) – Joint density in the plotted coordinates, with the same batch contract.

  • density_levels (Sequence[float] | None) – Positive increasing density contours. Automatic levels when omitted.

  • n_points (int) – Grid points per coordinate. A grid may miss small failure regions; the figure is not a probability estimate or validation certificate.

  • batch_size (int) – Maximum rows per model, density or surrogate call.

  • labels (Sequence[str]) – Axis labels; include physical units when applicable.

  • shade_failure (bool) – Shade the safe and failure regions of the true model.

  • ax (Axes | None) – Existing axes to draw into.

Returns:

figure, ax – Figure and axes, without calling show or changing analysis state.

Return type:

tuple[Figure, Axes]