code: def set_naxis(self, idx, n):
          
          self.play_idx = idx
          self.logger.debug("naxis %d index is %d" % (n + 1, idx + 1))
  
          image = self.fitsimage.get_image()
          slidername = 'choose_naxis%d' % (n + 1)
          try:
              if image is None:
                  raise ValueError("Please load an image cube")
  
              m = n - 2
  
              self.naxispath[m] = idx
              self.logger.debug("m=%d naxispath=%s" % (m, str(self.naxispath)))
  
              image.set_naxispath(self.naxispath)
              self.logger.debug("NAXIS%d slice %d loaded." % (n + 1, idx + 1))
  
              if self.play_indices:
                  # save play index
                  self.play_indices[m] = idx
                  text = [i + 1 for i in self.naxispath]
                  if slidername in self.w:
                      self.w[slidername].set_value(text[m])
              else:
                  text = idx + 1
                  if slidername in self.w:
                      self.w[slidername].set_value(text)
              self.w.slice.set_text(str(text))
  
              # schedule a redraw
              self.fitsimage.redraw(whence=0)
  
          except Exception as e:
              errmsg = "Error loading NAXIS%d slice %d: %s" % (
                  n + 1, idx + 1, str(e))
              self.logger.error(errmsg)
              self.fv.error(errmsg)
docs: Change the slice shown in the channel viewer.
          `idx` is the slice index (0-based); `n` is the axis (0-based)