plot_heatmap

jaxrens.postprocess.plotting.plot_heatmap(T, P, Z, *, ax=None, cmap='viridis', fmt='PT', vmin=None, vmax=None, do_colorbar=True, cbar_label=None, T_label='T', P_label='P', **pcolormesh_kwargs)[source]

Draw a 2D pressure-temperature heatmap of an observable.

Parameters:
  • T (np.ndarray) – Temperature grid, shape (n_T,).

  • P (np.ndarray) – Pressure grid, shape (n_P,). Must be sorted by the caller — pcolormesh does not reorder cells.

  • Z (np.ndarray) – Observable values, shape (n_P, n_T) (rows index pressure).

  • ax (Axes | None) – Existing axes to plot into. Created if None.

  • cmap (str) – Matplotlib colormap name.

  • fmt (str) – "PT" puts pressure on the x-axis, temperature on y. "TP" swaps them.

  • vmin (float | None) – Colour-scale clipping bounds; None uses the data range.

  • vmax (float | None) – Colour-scale clipping bounds; None uses the data range.

  • do_colorbar (bool) – Attach a colorbar to the figure when True.

  • cbar_label (str | None) – Label drawn next to the colorbar.

  • T_label (str) – Axis labels for the temperature / pressure axes.

  • P_label (str) – Axis labels for the temperature / pressure axes.

  • **pcolormesh_kwargs – Forwarded to ax.pcolormesh.

Returns:

The Axes object.

Return type:

Axes