
function [] = mixboundary(mix,data)

plotdata(data); hold on;

myax = axis; 

m = 50; % grid points for contour
tx = myax(1) + (myax(2)-myax(1))*(0:m)'/m;
ty = myax(3) + (myax(4)-myax(3))*(0:m)'/m;

[n,d] = size(data.X);

Z = zeros(m+1,m+1); 
for i=1:m+1,
    X = [tx,repmat(ty(i),m+1,1)];
    Z(:,i) = mixloglik(X,ones(m+1,1),mix)-mixloglik(X,zeros(m+1,1),mix);
end;

h=contour(tx,ty,Z',[0 0],'k-'); hold off;