function n = SpecArea(sizemin,sizeincrease,nosizes,noreal,type, par_a,par_b,pool_size,typeplot)
% sizemin: smallest community size
% sizeincrease: ratio of size of two successive communities (should be > 1)
% nosizes: number of community sizes 
% noreal: number of realizations of each community size
% remaining parameters see function distr
% typeplot 1/2: linear/log axis with community size

noind =[];
nospec=[];
evenness =[];
for i=1:nosizes
   nstemp =0;
   eventemp =0;
   for j=1:noreal
      size = round(sizemin.*(sizeincrease.^(i-1)));
      [n, ns, even] = comm(size,type, par_a,par_b,pool_size,0);
      nstemp = nstemp+ns;
      eventemp = eventemp + even;
   end
   
   noind = [noind size];
   nospec = [nospec nstemp/noreal];
   evenness = [evenness eventemp/noreal];
end
if (typeplot==1)
    figure;
    plot(noind,nospec);
    figure;
    plot(noind,evenness);

else
   figure;
   plot(log(noind),nospec);
   figure;
   plot(log(noind),evenness);
end

n = [noind;nospec];



   
