code: def show_color_bar(viewer, tf, side='bottom'):
      
  
      tag = '_$color_bar'
      canvas = viewer.get_private_canvas()
      try:
          cbar = canvas.get_object_by_tag(tag)
          if not tf:
              canvas.delete_object_by_tag(tag)
          else:
              cbar.side = side
  
      except KeyError:
          if tf:
              Cbar = canvas.get_draw_class('colorbar')
              canvas.add(Cbar(side=side), tag=tag, redraw=False)
  
      canvas.update_canvas(whence=3)
docs: Show a color bar in the window.
  
      Parameters
      ----------
      viewer : an ImageView subclass instance
          If True, show the color bar; else remove it if present.
  
      tf : bool
          If True, show the color bar; else remove it if present.
  
      side : str
          One of 'top' or 'bottom'. The default is 'bottom'.