geopfa.extrapolation.plot_array_with_coords

plot_array_with_coords(x, y, Z, title=None, cmap='viridis', vmin=None, vmax=None, aspect='equal', cbar_size='4%', cbar_pad=0.04, cbar_label='Value', figsize=(7, 6))[source]

Plot a 2D array Z using provided X-Y coordinates and a colorbar.

Parameters:
  • x (numpy.ndarray) – X coordinates, either 1-D (length Z.shape[1]) or 2-D (same shape as Z).

  • y (numpy.ndarray) – Y coordinates, same rules as x.

  • Z (numpy.ndarray) – 2-D array of values to plot.

  • title (str, optional) – Plot title.

  • cmap (str, optional) – Colormap name.

  • vmin (float, optional) – Lower bound of colormap (default: min of Z).

  • vmax (float, optional) – Upper bound of colormap (default: max of Z).

  • aspect (str, optional) – Axis aspect ratio, default "equal".

  • cbar_size (str, optional) – Width of colorbar relative to plot.

  • cbar_pad (float, optional) – Padding between plot and colorbar.

  • cbar_label (str, optional) – Colorbar label text.

  • figsize (tuple, optional) – Figure size.

Returns:

(Figure, Axes, Colorbar) – The created matplotlib figure, axes, and colorbar.