spectrochempy.plot_parity#
- plot_parity(Y, Y_hat, *, ax=None, clear=True, show=True, output=None, 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) vsY(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 whenaxis provided.show (
bool, optional) – Whether to display the figure. Default: True.output (str or
pathlib.Path, optional) – File name where the completed parity plot is saved. Saving happens after the reference line, the legend, and the labels are drawn.s (
floator array-like, optional) – Marker size in points**2.c (array-like or list of colors, optional) – Marker colors.
marker (
str, optional) – Marker style.cmap (
strorColormap, optional) – Colormap for scalar data mapping.norm (
strorNormalize, optional) – Normalization method for scalar data.vmin, vmax (
float, optional) – Data range for colormap.alpha (
float, optional) – Alpha blending value. Default: 0.5.linewidths (
floator 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
parityplotDeprecated alias for this function.