%z作者的Li_plot函数代码
% Created by LI Xu
% Version 1.0
% Feburary 27, 2016
% Description:
% Plot precipitation
% If you have any question about this code,
% please do not hesitate to contact me via E-mail:
% jeremy456@163.com
% Blog:
% http://blog.sciencenet.cn/u/lixujeremy
% http://lixuworld.blogspot.com/
function LI_plot(years, prec)
clf;
handle=bar(years, prec);
set(gca, 'xlim', [min(years)-1, max(years)+1]);
set(gca, 'fontname', 'Arial', 'fontsize', 15);
set(handle, 'facecolor', [0,1,1]);
set(gcf, 'color', 'w');
set(gca, 'ylim', [600, 1800]);
hold on;
% Trend Line
X=[ones(size(years)), years];
[b, ~, ~, ~, stats]=regress(prec, X);
b1=sprintf('%.3f