Consider:
numpoints = [1000 1000]; % [x y]
% build boundary curve
x = linspace(-2,2,numpoints(1));
y = 4*x-x.^3;
% build 2D map
y2 = linspace(-4,4,numpoints(2)).';
z = sin(x*2).*sin(y2*2);
% set unwanted map data to NaN
z(y2>y) = NaN;
% pcolor is probably what you're after
pcolor(x,y2,z)
% or you could use contourf if that's really what you want
%contourf(x,y2,z,'edgecolor','none')
hold on
% using a thick line helps hide the ragged edge
h = plot(x,y,'k','linewidth',3);
colormap(summer)
shading flat


