%%function chistplotfiles(files,sigma,binsize=0.1);
%%By Joakim Lindblad 2000-01-25
%% 
%% Plots histogram, continous version, second derivative, and threshold
%% of many files.
%%
%% files is search pattern of data files, e.g. '*.dat'
%% sigma is smoothing applied
%% binsize is resolution of histograms, default value is 0.1
%%
%% Can only handle scalar sigma value

function chistplotfiles(files,sigma,binsize);

if (nargin<3)
  binsize=0.1;
end;

d=dirren(files);
count=length(d);
cols=ceil(sqrt(count));
rows=ceil(count/cols);

clf
for i=1:count,
  data=load(d{i})';
  subplot(rows,cols,i);

  scale_height(0.9); %%make space for title
  chistplotone(data,binsize,sigma);
  title(sprintf('%s',d{i}));
end;
subplot;
