scatter()

audplot.scatter(truth, prediction, *, fit=False, order=1, ax=None)[source]

Scatter plot of truth and predicted values.

Parameters:
  • truth (Sequence | Series) – truth values

  • prediction (Sequence | Series) – predicted values

  • fit (bool) – if True, fit a regression model relating the x and y variables

  • order (int) – if greater than 1, estimate a polynomial regression model (see fit)

  • ax (Axes) – pre-existing axes for the plot. Otherwise, calls matplotlib.pyplot.gca() internally

Examples

>>> truth = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
>>> prediction = [0.1, 0.8, 2.3, 2.4, 3.9, 5, 6.2, 7.1, 7.8, 9, 9]
>>> scatter(truth, prediction, fit=True)
../_images/audplot-scatter-2.svg