Scan2DResult

class Scan2DResult(x_offsets, y_offsets, values, parameter_sets, center, direction_x, direction_y, program_type)[source]

Bases: object

Attributes Summary

Methods Summary

plot(*[, ax, show, levels, add_colorbar, ...])

Plot the sampled 2D landscape and return (fig, ax).

plot_3d(*[, ax, show])

Render the 2D landscape as a 3D surface and return (fig, ax).

Attributes Documentation

center: ndarray[tuple[Any, ...], dtype[float64]]
direction_x: ndarray[tuple[Any, ...], dtype[float64]]
direction_y: ndarray[tuple[Any, ...], dtype[float64]]
parameter_sets: ndarray[tuple[Any, ...], dtype[float64]]
program_type: str
values: ndarray[tuple[Any, ...], dtype[float64]]
x_offsets: ndarray[tuple[Any, ...], dtype[float64]]
y_offsets: ndarray[tuple[Any, ...], dtype[float64]]

Methods Documentation

plot(*, ax=None, show=False, levels=20, add_colorbar=True, show_gradients=False, gradient_kwargs=None, **contour_kwargs)[source]

Plot the sampled 2D landscape and return (fig, ax).

Parameters:
  • ax – Optional matplotlib axes to draw into. When omitted, a new figure and axes are created.

  • show (bool) – Whether to call matplotlib.pyplot.show() after drawing.

  • levels (int) – Number of contour levels passed to ax.contourf.

  • add_colorbar (bool) – Whether to attach a colorbar to the figure.

  • show_gradients (bool) – Whether to overlay a quiver plot of the numerical gradient (computed via numpy.gradient() on the grid).

  • gradient_kwargs (dict | None) – Optional keyword arguments forwarded to ax.quiver for the gradient overlay.

  • **contour_kwargs – Additional keyword arguments forwarded to ax.contourf.

Returns:

(fig, ax) for the rendered plot.

Return type:

tuple

plot_3d(*, ax=None, show=False, **surface_kwargs)[source]

Render the 2D landscape as a 3D surface and return (fig, ax).

Parameters:
  • ax – Optional Axes3D. When omitted, a new figure with a 3D projection is created.

  • show (bool) – Whether to call matplotlib.pyplot.show() after drawing.

  • **surface_kwargs – Additional keyword arguments forwarded to ax.plot_surface.

Returns:

(fig, ax) for the rendered 3D plot.

Return type:

tuple