code: def on_resize(self, event):
      # Set canvas viewport and reconfigure visual transforms to match.
      vp = (0, 0, self.physical_size[0], self.physical_size[1])
      self.context.set_viewport(*vp)
  
      self.image.transforms.configure(canvas=self, viewport=vp)
      self.vertical_bar.transforms.configure(canvas=self, viewport=vp)
  
file_path: vispy/examples/basics/visuals/colorbar_visual.py
imports: from vispy import app
  from vispy import gloo
  from vispy.visuals.transforms import STTransform
  from vispy.visuals import ColorBarVisual, ImageVisual
  from vispy.color import Color, get_colormap
  import numpy
label_desc: Use image node_id 2 for calling the Canvas obj's underlying member method code with example usage: obj.on_resize(event) without return types