function [xycor] = plotCorr(fignum, indices, prefix, titlex, titley, x, y)
    % plotCorr   Plot a scatter plot between the x and y columns given for
    % the given year.

    % filter data to given indices    
    x = x(indices);
    y = y(indices);
    % remove NaNs
    okvals = ~isnan(x) & ~isnan(y);
    x = x(okvals);
    y = y(okvals);
    % Calculate correlations
    cormat = corrcoef(x,y);
    % (either off-diagonal element will do)
    xycor = cormat(1,2);
    
    fprintf('%8s %14s vs. %-14s \t corr:%6.4f\n', prefix, titlex, titley, xycor);
    
    % plot and save scatter plot
    subplot(fignum(1), fignum(2), fignum(3));
    scatter(x,y);
    xlabel(titlex);
    xlim([min(x) max(x)]);
    ylabel(titley);
    ylim([min(y) max(y)]);
end
