code: def __init__(self):
      # dimensions of generated image
      img_dim = np.array([700, 500])
      # position of colorbar
      colorbar_pos = np.array([100, 300])
      # size of the colorbar, measured as (major, minor)
      colorbar_size = np.array([400, 20])
      # position of the generated image
      image_pos = np.array([200, 80])
  
      app.Canvas.__init__(self, size=(800, 600), keys="interactive")
  
      img_data = get_mandlebrot_escape_values(img_dim[0], img_dim[1])
      self.image = ImageVisual(img_data, cmap=colormap)
  
      self.image.transform = STTransform(scale=1.1, translate=image_pos)
  
      self.vertical_bar = get_vertical_bar(colorbar_pos, colorbar_size)
  
      self.show()
  
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 1 to create a new Canvas object from inherited base classes: app with example: obj = Canvas()