code: def plot_grid_and_trajectory(f_next_step, grid, coords):
      image_shape = grid.shape[1:-1]
      trajectory = detect_trajectory(f_next_step, grid[0], coords)
  
      trajectory_grid = np.zeros(image_shape)
      trajectory_grid[trajectory[:, 0], trajectory[:, 1]] = 1
  
      start_position = np.zeros(image_shape)
      start_position[coords[0], coords[1]] = 1
  
      # Grid world map
      plt.imshow(grid[0, :, :, 0], interpolation="none", cmap="binary")
  
      # Trajectory
      cmap = plt.cm.Reds
      cmap.set_under(alpha=0)
      plt.imshow(
          trajectory_grid,
          interpolation="none",
          cmap=cmap,
          clim=[0.1, 1.6],
      )
  
      # Start position
      cmap = plt.cm.Reds
      cmap.set_under(alpha=0)
      plt.imshow(
          start_position,
          interpolation="none",
          cmap=cmap,
          clim=[0.1, 1.1],
      )
  
      # Goal position
      cmap = plt.cm.Greens
      cmap.set_under(alpha=0)
      plt.imshow(
          grid[0, :, :, 1] / 10.0,
          interpolation="none",
          cmap=cmap,
          clim=[0.1, 1.1],
      )
  
      # Intercections between trajectories and obstacles
      cmap = plt.cm.Blues
      cmap.set_under(alpha=0)
      plt.imshow(
          np.bitwise_and(trajectory_grid == 1, grid[0, :, :, 0] == 1),
          interpolation="none",
          cmap=cmap,
          clim=[0.1, 1.1],
      )
  
file_path: neupy/examples/reinforcement_learning/vin/visualize.py
imports: from itertools import product
  import numpy
  import matplotlib.pyplot
  import matplotlib.gridspec
  import matplotlib.patches
  from neupy import storage
  from loaddata import load_data
  from train_vin import parser, create_VIN
  from settings import environments
  from evaluation import detect_trajectory
label_desc: Use image node_id 1 for calling a global function with example usage: plot_grid_and_trajectory(f_next_step, grid, coords) without return types