pvtend.plotting.plot_field_2d

pvtend.plotting.plot_field_2d(field: ndarray, x: ndarray, y: ndarray, *, title: str = '', cmap: str = 'coolwarm', symmetric: bool = True, vmin: float | None = None, vmax: float | None = None, contour_field: ndarray | None = None, contour_levels: int = 12, colorbar_label: str = '', ax: Axes | None = None, figsize: tuple[float, float] = (8, 6)) Axes[source]

Plot a 2D field on relative coordinates.

Parameters:
  • field – 2D array to plot.

  • x – 1D x-coordinates.

  • y – 1D y-coordinates.

  • title – Plot title.

  • cmap – Colormap name.

  • symmetric – Force symmetric color limits around zero.

  • vmin – Manual color limits (override symmetric).

  • vmax – Manual color limits (override symmetric).

  • contour_field – Optional field for contour overlay.

  • contour_levels – Number of contour levels.

  • colorbar_label – Label for the colorbar.

  • ax – Existing axes (creates new figure if None).

  • figsize – Figure size (used only if ax is None).

Returns:

The matplotlib Axes object.