function plotlocs(sloc,M1,M2,N1,N2)
%
% plot sample locations on grid
%

ep=1.e-10; % use small offset to ensure 0 values are plotted
           % I have no idea why this seems to necessary to plot
           % symbols at zero x in my version of matlab

% background grid of all possible sample points
[nn,mm]=ind2sub([N2,N1],1:N1*N2);
plot(mm+ep,nn+ep,'.c')

% now indicate sample locations
[n,m]=ind2sub([N2,N1],sloc(:));
hold on;
plot(m+ep,n+ep,'*k')
hold off;

% shrink axis to image size
axis([1 N1 1 N2])
