code: def get_plot(period=1):
      global plot_end
      x = np.arange(plot_end - 2 * math.pi, plot_end, 0.02)
      y = np.sin(2 * math.pi * period * x)
      fig = px.line(x=x, y=y)
      plot_end += 2 * math.pi
      if plot_end > 1000:
          plot_end = 2 * math.pi
      return fig
  
imports: import math
  import gradio
  import plotly.express
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: get_plot(period) and returns: fig