code: def _get_fiber_slice(self, plane=None, index=None):
          r
          if hasattr(self, '_fiber_image') is False:
              logger.warning('This method only works when a fiber image exists')
              return None
          if plane is None and index is None:
              logger.warning('Please provide a plane array or index array')
              return None
  
          if plane is not None:
              if 'array' not in plane.__class__.__name__:
                  plane = sp.asarray(plane)
              if sp.sum(plane == 0) != 2:
                  logger.warning('Plane argument must have two zero valued ' +
                                 'elements to produce a planar slice')
                  return None
              l = sp.asarray(sp.shape(self._fiber_image))
              s = sp.around(plane*l).astype(int)
              s[s>=self._fiber_image.shape] -= 1
          elif index is not None:
              if 'array' not in index.__class__.__name__:
                  index = sp.asarray(index)
              if sp.sum(index == 0) != 2:
                  logger.warning('Index argument must have two zero valued ' +
                                 'elements to produce a planar slice')
                  return None
              if 'int' not in str(index.dtype):
                  index = sp.around(index).astype(int)
              s = index
  
          if s[0] != 0:
              slice_image = self._fiber_image[s[0], :, :]
          elif s[1] != 0:
              slice_image = self._fiber_image[:, s[1], :]
          else:
              slice_image = self._fiber_image[:, :, s[2]]
  
          return slice_image
docs: r"""
          Plot an image of a slice through the fiber image
          plane contains percentage values of the length of the image in each
          axis
  
          Parameters
          ----------
          plane : array_like
          List of 3 values, [x,y,z], 2 must be zero and the other must be between
          zero and one representing the fraction of the domain to slice along
          the non-zero axis
  
          index : array_like
          similar to plane but instead of the fraction an index of the image is
          used