function [data] = plotHist(fignum, indices, title, data)
% plotHist   Plot a histogram for a certain year for a given set of data.
    data = data(indices);
    data = data(~isnan(data));
    fprintf('%-18s \t mean: %8.3f; sd: %8.3f\n', title, mean(data), std(data));
    
    % plot and save histogram    
    sh = subplot(2,3,fignum);
    [n, xout] = hist(data, 50);
    bar(xout,n,1,'w');
    xlabel(title);
    ylabel('counts'); 
    % make them prettier
    h = findobj(gca,'Type','patch');
    set(h,'FaceColor','k','EdgeColor','w')
    % and wider
    scalefac = 0.2;
    p = get(sh, 'pos');    
    p(1) = p(1) - scalefac/2;  % left
    p(2) = p(2) - scalefac/2;  % bottom
    p(3) = p(3) + scalefac;   % width
    p(4) = p(4) + scalefac;   % height
end
