I am trying to visualize Gaussian mixture Model's contour lines to my scatter plots but they do not show up properly, first I thought they are getting overlapped by the points but the problem persists even if I draw the lines first and then plot the scatter points.
My code to generate the plots:
mn = min(pcaX); mx = max(pcaX);
for i = 1:6
subplot(2,3,i);
gscatter(pcaTest(:,1), pcaTest(:,2), testLabels);
hold on;
ezcontour(@(x,y)pdf(models{i},[x y]), [mn(1) mx(1) mn(2) mx(2)]);
hold off, axis xy, title(['For class ',int2str(i),'components:',int2str(models{i}.NumComponents)]), xlabel('PC1'), ylabel('PC2');
end
That's how it looks: Notice the cut in contour lines