code: def plot_layer_dist(dist_ones, dist_zeros, option):
      layout_ind = copy.deepcopy(layout)
      layout_ind[
          "title"
      ] = f"Average distance between span tokens, grouped by {option}, per layer"
      layout_ind["uirevision"] = "some_constant"
      layout_ind["yaxis"] = {
          "title": "Average Distance Between Spans (t-SNE)"
      }
      layout_ind["xaxis"] = {"title": "Layer"}
      layout_ind["showlegend"] = True
  
      x = list(range(len(dist_ones)))
  
      figure = go.Figure()
      figure.add_trace(
          go.Scatter(
              x=x,
              y=dist_ones,
              mode="lines",
              name="True Coreferent Spans"
              if option == "target"
              else "Predicted to be Coreferent Spans",
          )
      )
      figure.add_trace(
          go.Scatter(
              x=x,
              y=dist_zeros,
              mode="lines",
              name="False Coreferent Spans"
              if option == "target"
              else "Predicted NOT to be Coreferent Spans",
          )
      )
      figure.add_trace(
          go.Scatter(
              x=x,
              y=dist_zeros - dist_ones,
              mode="lines",
              name="Delta (Red - Blue)",
          )
      )
  
      figure.layout = layout_ind
      figure.update_layout(legend=dict(font=dict(size=15), y=-0.2))
  
      return figure
  
file_path: nlp-architect/solutions/InterpreT/application/plotFunc.py
imports: import base64
  import copy
  from io import BytesIO
  import numpy
  import matplotlib.pyplot
  import plotly.graph_objects
label_desc: Use image node_id 6 for calling a global function with example usage: plot_layer_dist(dist_ones, dist_zeros, option) and returns: figure