function [slope, std] = plotfit(X, Y, datTitle)
% PLOTFIT  plot a fitted line to the given data. X is a vector (year) and 
% Y a (N,2) matrix containing data and std deviations.    
    [a b sigma_a sigma_b] = york_fit(X,Y(:,1)',0.0001,Y(:,2)',0.0001);    
    title(sprintf('%20s (fit gradient %.4f +- %.4f)', datTitle, b, 2*sigma_b));
    hold on;
    plot(X, a+b*X);
    ylabel('(deg C)');
    hold off;
    fprintf('%-10s   fit gradient %8.4f +/- %8.4f\n', datTitle, b, 2*sigma_b);
    % print result on graph
    %text(min(X), max(Y(:,1)+Y(:,2)), sprintf('fit gradient %.4f +- %.4f', b, 2*sigma_b));
    slope = b;
    std = sigma_b;
end