code: def _plt_spec(spec, ax, title):
      """Helper function to plot a spectrogram to an axis."""
      spec = np.rot90(spec)
      ax.matshow(
          spec, vmin=-5, vmax=1, aspect="auto", cmap=plt.cm.magma
      )
      ax.set_title(title)
      ax.set_xticks([])
      ax.set_yticks([])
  
imports: import io
  import ddsp
  from ddsp.core import tf_float32
  from ddsp.training.plotting import pianoroll_plot_setup
  import matplotlib.patches
  import matplotlib.pyplot
  from matplotlib.ticker import MaxNLocator
  import note_seq
  from note_seq import sequences_lib
  import numpy
  import tensorflow.compat.v2
label_desc: Use image node_id 4 for calling a global function with example usage: _plt_spec(spec, ax, title) without return types