ptmp=open_plot("/xwin"); resize(6*2.54,1.4); multiplot([1,1])

xrange(13.3,13.7);
yrange(0,50);

% use next for filecopy output  (do_filecopy=1; % set at prompt)
if (do_filecopy)
{
  pid=dup_plot("Smooth_vs_rebin.gif/gif",ptmp);
  resize(10*2.54*0.6,1./0.6); multiplot([1,1]);
}

label("Wavelength [Angstroms]",
      "Counts/bin", 
      "Top: Gaussian smoothed; Bottom: rebinned");

plot_data_counts(3,4);   osplot_data_counts(3,0.005,2);
oplot_data_counts(2,3);  osplot_data_counts(2,0.0025,2);
plot_group(brightest(10,where(wl(13.3,13.7))),5);

plot_data_counts(3,4);  oplot_data_counts(2,3);
group_data(3,2); group_data(2,2);

v3=get_data_counts(3);    v2=get_data_counts(2);
ohplot(v3.bin_lo, v3.bin_hi, v3.value/2, 2);
ohplot(v2.bin_lo,v2.bin_hi,v2.value/2, 2);

plot_group(brightest(10,where(wl(13.3,13.7))),5);

group_data(3,0);  group_data(4,0);    % undo grouping

if (do_filecopy)
{
  close_plot(pid); window(ptmp);
}
  
