%%function chistplot(filename,sigma,binsize=0.1);
%%By Joakim Lindblad 2000-01-25
%% 
%% Plots histogram, continous version, second derivative, and threshold
%% of a data file.
%%
%% filename is name of data file
%% sigma is smoothing applied
%% binsize is resolution of histograms, default value is 0.1
%%
%% Using an array of sigma values gives subplots

function chistplot(filename,sigma,binsize);

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

data=load(filename)';
count=length(sigma);
cols=ceil(sqrt(count));
rows=ceil(count/cols);

for i=1:count
  if (count>1)
    subplot(cols,rows,i);
  end;

  scale_height(0.9); %%make space for title
  chistplotone(data,binsize,sigma(i));
  title(sprintf('Sigma=%.2f',sigma(i)));
end;

if (count>1)
  subplot;
end;





