code: def rebuild_cmaps(self):
          
          self.logger.info("building color maps image")
          ht, wd, sep = self._cmht, self._cmwd, self._cmsep
          viewer = self.p_view
  
          # put the canvas into pick mode
          canvas = viewer.get_canvas()
          canvas.delete_all_objects()
  
          # get the list of color maps
          cm_names = self.cm_names
          num_cmaps = len(cm_names)
          viewer.configure_surface(500, (ht + sep) * num_cmaps)
  
          # create a bunch of color bars and make one large compound object
          # with callbacks for clicking on individual color bars
          l2 = []
          ColorBar = canvas.get_draw_class('drawablecolorbar')
          Text = canvas.get_draw_class('text')
          #ch_rgbmap = chviewer.get_rgbmap()
          #dist = ch_rgbmap.get_dist()
          dist = None
          #imap = ch_rgbmap.get_imap()
          logger = viewer.get_logger()
  
          for i, name in enumerate(cm_names):
              rgbmap = RGBMap.RGBMapper(logger, dist=dist)
              rgbmap.set_cmap(cmap.get_cmap(name))
              #rgbmap.set_imap(imap)
              x1, y1 = self._cmxoff, i * (ht + sep)
              x2, y2 = x1 + wd, y1 + ht
              cbar = ColorBar(x1, y1, x2, y2, cm_name=name, showrange=False,
                              rgbmap=rgbmap, coord='window')
              l2.append(cbar)
              l2.append(Text(x2 + sep, y2, name, color='white', fontsize=16,
                             coord='window'))
  
          Compound = canvas.get_draw_class('compoundobject')
          obj = Compound(*l2)
          canvas.add(obj)
  
          self._max_y = y2
  
          rgb_img = self.p_view.get_image_as_array()
          self.r_image.set_data(rgb_img)
docs: Builds a color RGB image containing color bars of all the
          possible color maps and their labels.