code: def create_plot():
      t = np.linspace(0, 10, 100)
      x = 0.1 * t * np.cos(np.pi * t)
      y = 0.1 * t * np.sin(np.pi * t)
      points = np.array([x, y]).T.reshape(100, 1, 2)
      segments = np.hstack([points[:-1], points[1:]])
  
      lc = LineCollection(
          segments,
          cmap=plt.cm.jet,
          norm=plt.Normalize(0, 10),
          array=t,
          linewidths=3,
      )
  
      fig, ax = plt.subplots()
      ax.add_collection(lc)
      plt.xlim(-1, 1)
      plt.ylim(-1, 1)
  
      ax.set_title("Line Collections", size=18)
  
      ax.xaxis.set_major_formatter(plt.NullFormatter())
      ax.yaxis.set_major_formatter(plt.NullFormatter())
      return fig
  
imports: import matplotlib.pyplot
  import numpy
  from matplotlib.collections import LineCollection
  import mpld3
label_desc: Use image node_id 1 for calling a global function with example usage: create_plot() and returns: fig