%function [n,x_axis]=disp_extrem(hurricane)
hurricane='isabel';

 rep='wavelength analysis\same_psd_length\unfiltered\extrem';
%rep='wavelength analysis\same_psd_length\unfiltered\extrem';

 mu_total=[];
 sigma_total=[];
thres=[0.5 1 2 2.5];
for jj=2
    threshold=num2str(thres(jj));
 %path=['C:\Documents and Settings\sylvie lorsolo\My Documents\research\',hurricane,'\data\',rep,'\dewrinkled\half\',threshold,'\'];
path=['C:\Documents and Settings\sylvie lorsolo\My Documents\research\',hurricane,'\data\',rep,'\unwrinkled\half\'];
%path=['C:\Documents and Settings\sylvie lorsolo\My Documents\research\frances\data\wavelength analysis\same_psd_length\filtered\1000_3000\extrem\'];
files=dir([path,'\*.mat']);

%For each trans at each height
total=[];

for fil=1:length(files)
    load([path,files(fil).name]);
    for i=2:length(wave)
        
        [lignes,colonnes]=size(wave(i).p_to_t);
        %[lignes,colonnes]=size(wave(i).p_to_p_pos);
        %peaks=wave(i).p_to_p;
        total=[total;wave(i).p_to_t];%[total;wave(i).p_to_p_pos;wave(i).p_to_p_neg];%
        
        
        
    end
    
end
    
edges=0:100:1200;
n=histc(total,edges);
x_axis=50:100:1200;
n=n(1:length(x_axis),:);
n1=n;
mu=[];
sigma=[];
for i=1:colonnes
%     u_NaN=find(~isnan(total(:,i)));
%     if length(u_NaN)==0
%         mu=[mu NaN];
%         sigma=[sigma NaN];
%     else
%         mu=[mu mean(total(u_NaN,i))];
%         sigma=[sigma std(total(u_NaN,i))];
%     end
    u_nzeros=find(n1(:,i) ~=0);
    somme=sum(n1(u_nzeros,i));
    n1(u_nzeros,i)=n1(u_nzeros,i)./somme;
end
mu_total=[mu_total;mu];
sigma_total=[sigma_total;sigma];
figure
z=0:25:25*(colonnes-1);
%  contourf(x_axis,z,n',25)
%  colorbar
%  shading flat
% title(['# of occurrences (unfilt)']);
 %figure
contourf(x_axis,z,100*n1',25)
shading flat
colorbar
%title(['Percentage (unfilt)  plan ',num2str(a)]);
end