function fh = plot_samples(dist,depth,varargin)
%
% Generate a column of distance vs depth plots of the given data.
% Call with the vector of distance and depth gridmarks, and
% optional pairs of the form dataname,datagrid, where dataname is a
% string, and datagrid is a length(depth) x length(dist) grid.
%

    cnum = 200; % number of contour lines

    numplots = size(varargin, 2)/2;
    if numplots ~= floor(numplots)
        error('Optional args must be in pairs!');
    end

    % Plot distance in kilometers (stored in meters)
    mdist = repmat(dist./1000,length(depth),1);
    mdepth = repmat(depth,1,length(dist));
    fh = figure('visible','off');
    set(fh,'OuterPosition',[50,60,1100,650]);
    for ii=1:numplots
        axh = subplot(numplots,1,ii);
        datastr = varargin{2*ii-1};
        mdata = varargin{2*ii};
        contourf(axh,mdist,mdepth,mdata,cnum,'LineColor','none');
        set(axh,'YDir','reverse');
        ylabel(axh,'Depth (m)');
        if(ii < numplots)
            set(axh,'XTickLabel',[]);
        else
            xlabel(axh,'Distance (km)');
        end
        colorbar('peer',axh);
        str = [datastr ' data'];
        title(axh,str);
    end
    set(fh,'visible','on');
end
