code: def heatmapf(func, scale=10, boundary=True, cmap=None, ax=None,
               scientific=False, style='triangular', colorbar=True,
               permutation=None, vmin=None, vmax=None, cbarlabel=None,
               cb_kwargs=None):
      
  
      # Apply the function to a simplex partition
      data = dict()
      for i, j, k in simplex_iterator(scale=scale, boundary=boundary):
          data[(i, j)] = func(normalize([i, j, k]))
      # Pass everything to the heatmapper
      ax = heatmap(data, scale, cmap=cmap, ax=ax, style=style,
                   scientific=scientific, colorbar=colorbar,
                   permutation=permutation, vmin=vmin, vmax=vmax, 
                   cbarlabel=cbarlabel, cb_kwargs=cb_kwargs)
      return ax
docs: Computes func on heatmap partition coordinates and plots heatmap. In other
      words, computes the function on lattice points of the simplex (normalized
      points) and creates a heatmap from the values.
  
      Parameters
      ----------
      func: Function
          A function of 3-tuples to be heatmapped
      scale: Integer
          The scale used to partition the simplex
      boundary: Bool, True
          Include the boundary points or not
      cmap: String, None
          The name of the Matplotlib colormap to use
      ax: Matplotlib axis object, None
          The axis to draw the colormap on
      style: String, "triangular"
          The style of the heatmap, "triangular", "dual-triangular" or "hexagonal"
      scientific: Bool, False
          Whether to use scientific notation for colorbar numbers.
      colorbar: bool, True
          Show colorbar.
      permutation: string, None
          A permutation of the coordinates
      vmin: float
          The minimum color value, used to normalize colors.
      vmax: float
          The maximum color value, used to normalize colors.
      cb_kwargs: dict
          dict of kwargs to pass to colorbar
  
      Returns
      -------
      ax, The matplotlib axis