0001 function [ylist,h,yy] = vb_plot_stat_hist(y,plist)
0002
0003
0004
0005
0006 N = length(plist);
0007 [Nch, Ntry] = size(y);
0008 Nbin = 500;
0009 ymax = max(y(:));
0010
0011 [h, yy] =hist(y(:),Nbin);
0012
0013 [ylist, p] = vb_find_hist_threshold(h,yy,plist);
0014
0015 ylist = [ylist, ymax];
0016
0017
0018 dy = yy(2) - yy(1);
0019 pd = p / dy;
0020
0021 plot(yy,pd);
0022
0023 hold on
0024 type = {'r--', 'b--', 'm--', 'c--'};
0025
0026 for n=1:N-1
0027 plot([ylist(n) ylist(n)],[0 max(pd)], type{n})
0028 end
0029
0030 xlim([0 ylist(N)])