code: def plot_distribution(
      X: gf.base.AnyNDArray,
      Y: gf.base.AnyNDArray,
      X_plot: Optional[gf.base.AnyNDArray] = None,
      mean_plot: Optional[gf.base.AnyNDArray] = None,
      var_plot: Optional[gf.base.AnyNDArray] = None,
      X_err: Optional[gf.base.AnyNDArray] = None,
      mean_err: Optional[gf.base.AnyNDArray] = None,
      var_err: Optional[gf.base.AnyNDArray] = None,
  ) -> None:
      plt.figure(figsize=(15, 5))
  
      X = X.squeeze(axis=-1)
      Y = Y.squeeze(axis=-1)
      plt.scatter(X, Y, color="gray", alpha=0.8)
  
      def get_confidence_bounds(
          mean: gf.base.AnyNDArray, var: gf.base.AnyNDArray
      ) -> Tuple[gf.base.AnyNDArray, gf.base.AnyNDArray]:
          std = np.sqrt(var)
          return mean - 1.96 * std, mean + 1.96 * std
  
      if X_plot is not None:
          assert mean_plot is not None
          assert var_plot is not None
          X_plot = X_plot.squeeze(axis=-1)
          mean_plot = mean_plot.squeeze(axis=-1)
          var_plot = var_plot.squeeze(axis=-1)
          lower_plot, upper_plot = get_confidence_bounds(
              mean_plot, var_plot
          )
          plt.fill_between(
              X_plot, lower_plot, upper_plot, color="silver", alpha=0.25
          )
          plt.plot(X_plot, lower_plot, color="silver")
          plt.plot(X_plot, upper_plot, color="silver")
          plt.plot(X_plot, mean_plot, color="black")
  
      if X_err is not None:
          assert mean_err is not None
          assert var_err is not None
          lower_err, upper_err = get_confidence_bounds(
              mean_err, var_err
          )
          plt.vlines(X_err, lower_err, upper_err, color="black")
  
      plt.xlim([0, 1])
      plt.show()
  
file_path: GPflow/doc/sphinx/notebooks/advanced/varying_noise.pct.py
imports: import os
  import warnings
  from typing import Optional, Tuple
  import matplotlib.pyplot
  import numpy
  import tensorflow
  from check_shapes import inherit_check_shapes
  import gpflow
  from gpflow.ci_utils import reduce_in_tests
  from gpflow.utilities import print_summary
label_desc: Use image node_id 1 for calling a global function with example usage: plot_distribution(X, Y, X_plot, mean_plot, var_plot, X_err, mean_err, var_err) and returns: unknown,  unknown