code: def plot_model(
      model: gpflow.models.GPModel,
      *,
      min_x: float,
      max_x: float,
      optimise: bool = True,
  ) -> None:
      _, ax = plt.subplots(nrows=1, ncols=1)
  
      if optimise:
          opt = gpflow.optimizers.Scipy()
          opt.minimize(model.training_loss, model.trainable_variables)
  
      Xplot = np.linspace(min_x, max_x, 300)[:, None]
  
      f_mean, f_var = model.predict_f(Xplot, full_cov=False)
      f_lower = f_mean - 1.96 * np.sqrt(f_var)
      f_upper = f_mean + 1.96 * np.sqrt(f_var)
  
      ax.hlines(
          0.0,
          min_x,
          max_x,
          colors="black",
          linestyles="dotted",
          alpha=0.3,
      )
      ax.scatter(X, Y, color="black")
      (mean_line,) = ax.plot(Xplot, f_mean, "-")
      color = mean_line.get_color()
      ax.plot(Xplot, f_lower, lw=0.1, color=color)
      ax.plot(Xplot, f_upper, lw=0.1, color=color)
      ax.fill_between(
          Xplot[:, 0],
          f_lower[:, 0],
          f_upper[:, 0],
          color=color,
          alpha=0.1,
      )
  
file_path: GPflow/doc/sphinx/notebooks/getting_started/mean_functions.pct.py
imports: import os
  import warnings
  import matplotlib.pyplot
  import numpy
  import tensorflow
  from check_shapes import inherit_check_shapes
  import gpflow
label_desc: Use image node_id 1 for calling a global function with example usage: plot_model(model) without return types