docstr: This method plots the sampled GP distribution at the test points in
  solid colors, as well as the predictive mean as the dashed red line.
  Plus and minus 2 predictive standard deviations are shown in the grey
  region. The training points are shown as the blue dots.
  
  Parameters
  ----------
  ts_idx
      Time series index to plot
  x_train
      Training set of features of shape
      (batch_size, context_length, num_features).
  y_train
      Training labels of shape (batch_size, context_length).
  x_test
      Test set of features of shape
      (batch_size, prediction_length, num_features).
  mean
       Mean of the GP of shape (batch_size, prediction_length).
  std
      Standard deviation of the GP of shape
      (batch_size, prediction_length, 1).
  samples
      GP samples of shape (batch_size, prediction_length, num_samples).
  axis
      Plot axes limits
docstr_tok: ["This","method","plots","the","sampled","GP","distribution","at","the","test","points","in","solid","colors",",","as","well","as","the","predictive","mean","as","the","dashed","red","line",".","Plus","and","minus","2","predictive","standard","deviations","are","shown","in","the","grey","region",".","The","training","points","are","shown","as","the","blue","dots",".","Parameters","--","--","--","--","--","ts_idx","Time","series","index","to","plot","x_train","Training","set","of","features","of","shape","(","batch_size",",","context_length",",","num_features",")",".","y_train","Training","labels","of","shape","(","batch_size",",","context_length",")",".","x_test","Test","set","of","features","of","shape","(","batch_size",",","prediction_length",",","num_features",")",".","mean","Mean","of","the","GP","of","shape","(","batch_size",",","prediction_length",")",".","std","Standard","deviation","of","the","GP","of","shape","(","batch_size",",","prediction_length",",","1",")",".","samples","GP","samples","of","shape","(","batch_size",",","prediction_length",",","num_samples",")",".","axis","Plot","axes","limits"]
code: def plot(
      ts_idx: int,
      x_train: Optional[Tensor] = None,
      y_train: Optional[Tensor] = None,
      x_test: Optional[Tensor] = None,
      mean: Optional[Tensor] = None,
      std: Optional[Tensor] = None,
      samples: Optional[Tensor] = None,
      axis: Optional[Tuple[float, float, float, float]] = None,
  ) -> None:
      """
      This method plots the sampled GP distribution at the test points in
      solid colors, as well as the predictive mean as the dashed red line.
      Plus and minus 2 predictive standard deviations are shown in the grey
      region. The training points are shown as the blue dots.
  
      Parameters
      ----------
      ts_idx
          Time series index to plot
      x_train
          Training set of features of shape
          (batch_size, context_length, num_features).
      y_train
          Training labels of shape (batch_size, context_length).
      x_test
          Test set of features of shape
          (batch_size, prediction_length, num_features).
      mean
           Mean of the GP of shape (batch_size, prediction_length).
      std
          Standard deviation of the GP of shape
          (batch_size, prediction_length, 1).
      samples
          GP samples of shape (batch_size, prediction_length, num_samples).
      axis
          Plot axes limits
      """
  
      # matplotlib==2.0.* gives errors in Brazil builds and has to be
      # imported locally
      import matplotlib.pyplot as plt
  
      if x_train is not None:
          x_train = x_train[ts_idx, :, :].asnumpy()
          if y_train is not None:
              y_train = y_train[ts_idx, :].asnumpy()
              plt.plot(x_train, y_train, "bs", ms=8)
      if x_test is not None:
          x_test = x_test[ts_idx, :, :].asnumpy()
          if samples is not None:
              samples = samples[ts_idx, :, :].asnumpy()
              plt.plot(x_test, samples)
          if mean is not None:
              mean = mean[ts_idx, :].asnumpy()
              plt.plot(x_test, mean, "r--", lw=2)
              if std is not None:
                  std = std[ts_idx, :].asnumpy()
                  plt.gca().fill_between(
                      x_test.flat,
                      mean - 2 * std,
                      mean + 2 * std,
                      color="#dddddd",
                  )
      if axis is not None:
          plt.axis(axis)
      plt.title(f"Samples from GP for time series {ts_idx}")
      plt.show()
  
file_path: gluonts/src/gluonts/mx/model/gp_forecaster/gaussian_process.py
imports: from typing import Optional, Tuple, Type
  import mxnet
  import numpy
  from gluonts.mx import Tensor
  from gluonts.mx.distribution import MultivariateGaussian
  from gluonts.mx.distribution.distribution import getF
  from gluonts.mx.kernels import Kernel
  from gluonts.mx.linalg_util import batch_diagonal, jitter_cholesky, jitter_cholesky_eig
label_desc: Use image node_id 6 for calling the GaussianProcess obj's underlying member method code with example usage: obj.plot(ts_idx, x_train, y_train, x_test, mean, std, samples, axis) without return types