code: def plot_alignment_to_numpy(
      alignment,
      title="",
      info=None,
      phoneme_seq=None,
      vmin=None,
      vmax=None,
  ):
      if phoneme_seq:
          fig, ax = plt.subplots(figsize=(15, 10))
      else:
          fig, ax = plt.subplots(figsize=(6, 4))
      im = ax.imshow(
          alignment,
          aspect="auto",
          origin="lower",
          interpolation="none",
          vmin=vmin,
          vmax=vmax,
      )
      ax.set_title(title)
      fig.colorbar(im, ax=ax)
      xlabel = "Decoder timestep"
      if info is not None:
          xlabel += "\n\n" + info
      plt.xlabel(xlabel)
      plt.ylabel("Encoder timestep")
      plt.tight_layout()
  
      if phoneme_seq != None:
          # for debugging of phonemes and durs in maps. Not used by def in training code
          ax.set_yticks(np.arange(len(phoneme_seq)))
          ax.set_yticklabels(phoneme_seq)
          ax.hlines(
              np.arange(len(phoneme_seq)),
              xmin=0.0,
              xmax=max(ax.get_xticks()),
          )
  
      fig.canvas.draw()
      data = save_figure_to_numpy(fig)
      plt.close()
      return data
  
imports: from enum import Enum
  from typing import Optional, Tuple
  import librosa
  import matplotlib.pylab
  import numpy
  import torch
  from einops import rearrange
  from numba import jit, prange
  from nemo.collections.tts.torch.tts_data_types import DATA_STR2DATA_CLASS, MAIN_DATA_TYPES, WithLens
  from nemo.utils import logging
  from nemo.utils.decorators import deprecated
label_desc: Use image node_id 15 for calling a global function with example usage: plot_alignment_to_numpy(alignment, title, info, phoneme_seq, vmin, vmax) and returns: data