function [maxVal, argMax, constrainedMaxVal, constrainedArgMax] = plotter(f, plotIntervalx, plotIntervaly)
  maxVal = -inf;
  constrainedMaxVal = -inf;
  argMax=zeros(1,2);
  constrainedArgMax=zeros(1,2);
  if (nargin == 0)
    f = @(x, y) x .* log (1 ./ x) / log (2) + y .* log (1 ./ y) / log (2);
  end
  if (nargin < 2)
    stepsizex = stepsizey = 0.05;
    plotIntervalx = plotIntervaly = [eps:stepsizex:1];
  else
    if (nargin < 3)
      plotIntervaly = plotIntervalx;
    end
    stepsizex = plotIntervalx(2) - plotIntervalx(1);
    stepsizey = plotIntervaly(2) - plotIntervaly(1);
  end
  [xx, yy] = meshgrid(plotIntervalx, plotIntervaly);
  z = f(xx, yy);
  for k=1:size(z, 1)
    x1 = stepsizex * (k-1);
    for l=1:size(z,2)
      x2 = stepsizey * (l-1);
      if z(k,l) > maxVal
        maxVal = z(k,l);
        argMax = [x1, x2];
      end
      if x1+x2==1 && z(k,l) > constrainedMaxVal
        constrainedMaxVal = z(k,l);
        constrainedArgMax = [x1, x2];
      end
    end
  end
  mesh(plotIntervalx, plotIntervaly, z);
end
