code: def update(val):
      # The val passed to a callback by the RangeSlider will
      # be a tuple of (min, max)
  
      # Update the image's colormap
      im.norm.vmin = val[0]
      im.norm.vmax = val[1]
  
      # Update the position of the vertical lines
      lower_limit_line.set_xdata([val[0], val[0]])
      upper_limit_line.set_xdata([val[1], val[1]])
  
      # Redraw the figure to ensure it updates
      fig.canvas.draw_idle()
  
imports: import matplotlib.pyplot
  import numpy
  from matplotlib.widgets import RangeSlider
label_desc: Use image node_id 1 for calling a global function with example usage: update(val) without return types