code: def updateHDF5Plot(self):
      if self.hdf5 is None:
          self.setData([])
          return
  
      vb = self.getViewBox()
      if vb is None:
          return  # no ViewBox yet
  
      # Determine what data range must be read from HDF5
      range_ = vb.viewRange()[0]
      start = max(0, int(range_[0]) - 1)
      stop = min(len(self.hdf5), int(range_[1] + 2))
  
      # Decide by how much we should downsample
      ds = int((stop - start) / self.limit) + 1
  
      if ds == 1:
          # Small enough to display with no intervention.
          visible = self.hdf5[start:stop]
          scale = 1
      else:
          # Here convert data into a down-sampled array suitable for visualizing.
          # Must do this piecewise to limit memory usage.
          samples = 1 + ((stop - start) // ds)
          visible = np.zeros(samples * 2, dtype=self.hdf5.dtype)
          sourcePtr = start
          targetPtr = 0
  
          # read data in chunks of ~1M samples
          chunkSize = (1000000 // ds) * ds
          while sourcePtr < stop - 1:
              chunk = self.hdf5[
                  sourcePtr : min(stop, sourcePtr + chunkSize)
              ]
              sourcePtr += len(chunk)
  
              # reshape chunk to be integral multiple of ds
              chunk = chunk[: (len(chunk) // ds) * ds].reshape(
                  len(chunk) // ds, ds
              )
  
              # compute max and min
              chunkMax = chunk.max(axis=1)
              chunkMin = chunk.min(axis=1)
  
              # interleave min and max into plot data to preserve envelope shape
              visible[
                  targetPtr : targetPtr + chunk.shape[0] * 2 : 2
              ] = chunkMin
              visible[
                  1 + targetPtr : 1 + targetPtr + chunk.shape[0] * 2 : 2
              ] = chunkMax
              targetPtr += chunk.shape[0] * 2
  
          visible = visible[:targetPtr]
          scale = ds * 0.5
  
      self.setData(visible)  # update the plot
      self.setPos(start, 0)  # shift to match starting index
      self.resetTransform()
      self.scale(scale, 1)
  
file_path: pyqtgraph/pyqtgraph/examples/hdf5.py
imports: import os
  import sys
  import h5py
  import numpy
  import pyqtgraph
  from pyqtgraph.Qt import QtWidgets
label_desc: Use image node_id 4 for calling the HDF5Plot obj's underlying member method code with example usage: obj.updateHDF5Plot() without return types