code: def updateRoiPlot(roi, data=None):
      if data is None:
          data = roi.getArrayRegion(im1.image, img=im1)
      if data is not None:
          roi.curve.setData(data.mean(axis=1))
  
imports: import numpy
  import pyqtgraph
  from pyqtgraph.Qt import QtCore, QtGui
label_desc: Use image node_id 2 for calling a global function with example usage: updateRoiPlot(roi, data) without return types