code: def plot_2d_model(model: gpflow.models.GPModel) -> None:
      n_grid = 50
      _, (ax_mean, ax_std) = plt.subplots(
          nrows=1, ncols=2, figsize=(11, 5)
      )
      Xplots = np.linspace(0.0, 1.0, n_grid)
      Xplot1, Xplot2 = np.meshgrid(Xplots, Xplots)
      Xplot = np.stack([Xplot1, Xplot2], axis=-1)
      Xplot = Xplot.reshape([n_grid**2, 2])
  
      iv = getattr(model, "inducing_variable", None)
      # Do not optimize inducing variables, so that we can better see the impact their choice has. When solving
      # a real problem you should generally optimise your inducing points.
      if iv is not None:
          gpflow.set_trainable(iv, False)
      opt = gpflow.optimizers.Scipy()
      opt.minimize(model.training_loss, model.trainable_variables)
  
      y_mean, y_var = model.predict_y(Xplot)
      y_mean = y_mean.numpy()
      y_std = tf.sqrt(y_var).numpy()
  
      ax_mean.pcolor(Xplot1, Xplot2, y_mean.reshape(Xplot1.shape))
      ax_std.pcolor(Xplot1, Xplot2, y_std.reshape(Xplot1.shape))
      ax_mean.scatter(X[:, 0], X[:, 1], s=50, c="black")
      ax_std.scatter(X[:, 0], X[:, 1], s=50, c="black")
  
      # Also plot the inducing variables if possible:
      if iv is not None:
          ax_mean.scatter(
              iv.Z[:, 0], iv.Z[:, 1], marker="x", color="red"
          )
  
file_path: GPflow/notebooks/getting_started/large_data.pct.py
imports: import os
  import warnings
  import matplotlib.pyplot
  import numpy
  import tensorflow
  import tensorflow_probability
  import gpflow
  from scipy.cluster.vq import kmeans
label_desc: Use image node_id 2 for calling a global function with example usage: plot_2d_model(model) without return types