code: def plot_1d_grid(
      x_s,
      y_mean,
      y_std,
      X_train,
      y_train,
      title=None,
      save=False,
      name=None,
      y_preds=None,
      type=None,
  ):
      if name is None:
          name = title[0:3]
  
      # plot predictions
      # fig = plt.figure(figsize=(3, 2))
      # fig = plt.figure(figsize=(5, 3)) # intro panel
      fig = plt.figure(figsize=(5, 4))  # usual
      ax = fig.add_subplot(111)
      # plt.plot(x, f(x), 'r:', label=u'$f(x) = x\,\sin(x)$')
  
      if True:
          ax.plot(x_s, y_mean, "b-", linewidth=2.0, label="Prediction")
          ax.plot(x_s, y_mean + 2 * y_std, "b", linewidth=0.5)
          ax.plot(x_s, y_mean - 2 * y_std, "b", linewidth=0.5)
          ax.plot(x_s, y_mean + 1 * y_std, "b", linewidth=0.5)
          ax.plot(x_s, y_mean - 1 * y_std, "b", linewidth=0.5)
          ax.fill(
              np.concatenate([x_s, x_s[::-1]]),
              np.concatenate(
                  [y_mean - 2 * y_std, (y_mean + 2 * y_std)[::-1]]
              ),
              alpha=1,
              fc="lightskyblue",
              ec="None",
          )
          ax.fill(
              np.concatenate([x_s, x_s[::-1]]),
              np.concatenate(
                  [y_mean - 1 * y_std, (y_mean + 1 * y_std)[::-1]]
              ),
              alpha=1,
              fc="deepskyblue",
              ec="None",
          )
  
      # if not y_preds is None and (type[0:4]=='conv' or type[0:4]=='intr'):
      if (
          False and not y_preds is None
      ):  # make true to plot individual NN predictions
          # ax.plot(x_s, y_preds.T, 'k', linewidth=2/np.sqrt(y_preds.T.shape[1])) # for intro panel
          ax.plot(
              x_s,
              y_preds.T,
              "k",
              linewidth=1 / np.sqrt(y_preds.T.shape[1]),
          )
  
      if True:
          ax.plot(
              X_train[:, 0],
              y_train,
              "r.",
              markersize=14,
              label="Observations",
              markeredgecolor="k",
              markeredgewidth=0.5,
          )
      # ax.plot(X, y, 'r.', markersize=10, label=u'Observations', markeredgecolor='k',markeredgewidth=0.5)
  
      # plt.title(title)
      # plt.xlabel('$x$')
      # plt.ylabel('$f(x)$')
      if save:
          ax.set_yticklabels([])
          ax.set_xticklabels([])
          if False:
              ax.set_yticks([])
              ax.set_xticks([])
      # ax.set_ylim(-2.3, 1.2)
      # ax.set_xlim(-2.5, 2.5)
      # ax.set_ylim(-3, 15)
  
      if True:
          if type == "panel/favfig_erf_low_noise_":
              ax.set_ylim(
                  -2.3, 1.2
              )  # panel, favourite_fig with erf, low data noise
              ax.set_xlim(-2.5, 2.5)
          elif type == "panel/favfig_relu_low_noise_":
              ax.set_ylim(-3, 0.7)
              ax.set_xlim(-1.7, 1.5)
          elif type == "converge_favfig_relu_low_noise_":
              ax.set_ylim(-3, 1)
              ax.set_xlim(-1.7, 1.7)
          elif type == "panel/favfig_Lrelu_low_noise_":
              ax.set_ylim(-3, 1)
              ax.set_xlim(-1.7, 1.7)
          elif type == "panel/favfig_rbf_low_noise_":
              ax.set_ylim(-2.5, 1)
              ax.set_xlim(-6, 6)
          elif type == "need_ensembles":
              ax.set_ylim(-3, 2.5)
              ax.set_xlim(-3, 3)
          elif type == "intro_panel":
              # ax.set_ylim(-3, 2.5)
              ax.set_xlim(-3, 3)
      # else:
      # ax.set_ylim(-7, 1)
      # ax.set_xlim(-3,3)
  
      # ax.set_xlim(np.min(x_s), np.max(x_s))
      # ax.grid(color='k', linestyle='--', linewidth=.3, dashes=(2,7)) # these don't come out well on pdf
      # plt.legend(loc='upper left')
      fig.show()
      if save:
          fig.savefig(
              "00_outputs_graph/" + type + "/" + title + ".eps",
              format="eps",
              dpi=1000,
              bbox_inches="tight",
          )
          # fig.savefig('00_outputs_graph/converge_favfig_relu_low_noise_/' + title +'.eps', format='eps', dpi=1000, bbox_inches='tight')
  
      return
  
file_path: elu-gelu-kernels/code/experiments/02_shallow_experiments/utils.py
imports: import numpy
  import scipy.stats
  import matplotlib.pyplot
  import datetime
label_desc: Use image node_id 7 for calling a global function with example usage: plot_1d_grid(x_s, y_mean, y_std, X_train, y_train, title, save, name, y_preds, type) without return types