spectrochempy.plot_parity

plot_parity(Y, Y_hat, *, ax=None, clear=True, show=True, s=None, c=None, marker=None, cmap=None, norm=None, vmin=None, vmax=None, alpha=0.5, linewidths=None, edgecolors=None, plotnonfinite=False, data=None, **kwargs)[source]

Plot predicted vs measured values (parity plot).

Creates a scatter plot of Y_hat (predicted) vs Y (measured) with a diagonal reference line (y = x).

Parameters:
  • Y (NDDataset) – Measured values.

  • Y_hat (NDDataset) – Predicted values.

  • ax (Axes, optional) – Axes to plot on. If None, a new figure is created.

  • clear (bool, optional) – Whether to clear the axes before plotting. Default: True. Only used when ax is provided.

  • show (bool, optional) – Whether to display the figure. Default: True.

  • s (float or array-like, optional) – Marker size in points**2.

  • c (array-like or list of colors, optional) – Marker colors.

  • marker (str, optional) – Marker style.

  • cmap (str or Colormap, optional) – Colormap for scalar data mapping.

  • norm (str or Normalize, optional) – Normalization method for scalar data.

  • vmin, vmax (float, optional) – Data range for colormap.

  • alpha (float, optional) – Alpha blending value. Default: 0.5.

  • linewidths (float or array-like, optional) – Linewidth of marker edges.

  • edgecolors (color or sequence of colors, optional) – Edge color of markers.

  • plotnonfinite (bool, optional) – Whether to plot nonfinite data. Default: False.

  • data (optional) – Unused parameter for compatibility.

  • **kwargs – Additional keyword arguments passed to scatter.

Returns:

Axes – The matplotlib axes containing the plot.

See also

parityplot

Deprecated alias for this function.