code: def plot_itakura(
      n_timestamps_1, n_timestamps_2, max_slope=1.0, ax=None
  ):
      """Plot Itakura parallelogram."""
      region = itakura_parallelogram(
          n_timestamps_1, n_timestamps_2, max_slope
      )
      max_slope, min_slope = _get_itakura_slopes(
          n_timestamps_1, n_timestamps_2, max_slope
      )
      mask = np.zeros((n_timestamps_2, n_timestamps_1))
      for i, (j, k) in enumerate(region.T):
          mask[j:k, i] = 1.0
  
      plt.imshow(mask, origin="lower", cmap="Wistia")
  
      sz = max(n_timestamps_1, n_timestamps_2)
      x = np.arange(-1, sz + 1)
  
      low_max_line = (
          (n_timestamps_2 - 1) - max_slope * (n_timestamps_1 - 1)
      ) + max_slope * np.arange(-1, sz + 1)
      up_min_line = (
          (n_timestamps_2 - 1) - min_slope * (n_timestamps_1 - 1)
      ) + min_slope * np.arange(-1, sz + 1)
      diag = (
          (n_timestamps_2 - 1)
          / (n_timestamps_1 - 1)
          * np.arange(-1, sz + 1)
      )
      plt.plot(x, diag, "black", lw=1)
      plt.plot(x, max_slope * np.arange(-1, sz + 1), "b", lw=1.5)
      plt.plot(x, min_slope * np.arange(-1, sz + 1), "r", lw=1.5)
      plt.plot(x, low_max_line, "g", lw=1.5)
      plt.plot(x, up_min_line, "y", lw=1.5)
  
      for i in range(n_timestamps_1):
          for j in range(n_timestamps_2):
              plt.plot(i, j, "o", color="green", ms=1)
  
      ax.set_xticks(np.arange(-0.5, n_timestamps_1, 1), minor=True)
      ax.set_yticks(np.arange(-0.5, n_timestamps_2, 1), minor=True)
      plt.grid(which="minor", color="b", linestyle="--", linewidth=1)
      plt.xticks(np.arange(0, n_timestamps_1, 2))
      plt.yticks(np.arange(0, n_timestamps_2, 2))
      plt.xlim((-0.5, n_timestamps_1 - 0.5))
      plt.ylim((-0.5, n_timestamps_2 - 0.5))
  
imports: import numpy
  import matplotlib.pyplot
  from pyts.metrics import itakura_parallelogram
  from pyts.metrics.dtw import _get_itakura_slopes
label_desc: Use image node_id 1 for calling a global function with example usage: plot_itakura(n_timestamps_1, n_timestamps_2, max_slope, ax) without return types