function hist0(y);

n    = length(y);
if (max(y)>8192 | min(y)<1/16384);
  disp('WARNING: labels will be wrong for this example')
end;
mx   = ceil(log(max(y))/log(2));
mn   = floor(log(min(y))/log(2));

j    = 0;
for i=mn:mx-1;
  j    = j+1;
  z(j) = sum(y>2^i & y<=2^(i+1))/n;
  x(j) = log(2^(i+1));
end;
dx   = (x(2)-x(1))/2;
x    = x-dx;
x1   = [x-dx x(length(x))+dx];

j      = 0;
for i=mn:-1;
  l      = length(int2str(2^(-i)));
  j      = j+1;
  if l==4;
    labels(j,:) = ['1/',int2str(2^(-i))];  
  elseif l==3;
    labels(j,:) = ['1/',int2str(2^(-i)),' '];  
  elseif l==2;
    labels(j,:) = ['1/',int2str(2^(-i)),'  '];  
  elseif l==1;
    labels(j,:) = ['1/',int2str(2^(-i)),'   '];  
  end;
end;
for i=0:mx;
  l      = length(int2str(2^i));
  j      = j+1;
  if l==1;
    labels(j,:) = [int2str(2^i),'     '];  
  elseif l==2;
    labels(j,:) = [int2str(2^i),'    '];  
  elseif l==3;
    labels(j,:) = [int2str(2^i),'   '];  
  elseif l==4;
    labels(j,:) = [int2str(2^i),'  '];  
  end;
end;
tem = max(0.3,max(z));
bar(x,z),set(gca,'YLim',[0.0 tem],'XTickLabel',labels,'XTick',x1);

