code: def residuals(y_true, y_pred, ax=None):
      """
      Plot the residuals between measured and predicted values.
  
      Parameters
      ----------
      y_true : array-like, shape = [n_samples]
          Measured target values (ground truth).
      y_pred : array-like, shape = [n_samples]
          Predicted target values.
      ax : matplotlib Axes
          Axes object to draw the plot onto, otherwise uses current Axes
  
      Returns
      -------
      ax: matplotlib Axes
          Axes containing the plot
  
      Examples
      --------
      .. plot:: ../examples/residuals.py
  
      """
  
      _check_parameter_validity(y_true, y_pred)
  
      if ax is None:
          ax = plt.gca()
  
      # horizontal line for residual=0
      ax.axhline(y=0)
  
      ax.scatter(y_pred, y_true - y_pred)
  
      _set_ax_settings(
          ax, "Predicted Value", "Residuals", "Residuals Plot"
      )
      return ax
  
file_path: sklearn-evaluation/src/sklearn_evaluation/plot/regression.py
imports: import matplotlib.pyplot
  import numpy
  import pandas
  from sklearn_evaluation.telemetry import SKLearnEvaluationLogger
  from sklearn.linear_model import LinearRegression
  from ploomber_core.exceptions import modify_exceptions
label_desc: Use image node_id 3 for calling a global function with example usage: residuals(y_true, y_pred, ax) and returns: ax