function dump_plot_demos ()
  close all
  more off
  diary diary.log

function waterfall_01 ()
    
 clf;
 colormap ('default');
 Z = peaks ();
 waterfall (Z);
 title ('waterfall() plot of peaks() function');

end

for k=1:1000

  delete ("*.png");

  try
    if (~ exist ('waterfall_01.png', 'file'))
      rand ('seed', 1);
      tic ();
      waterfall_01 ();
      t_plot = toc ();
      fig = (get (0, 'currentfigure'));
      if (~ isempty (fig))
        figure (fig);
        fprintf ('Printing "waterfall_01.png" ... ');
        tic ();
        print ('-dpng', 'waterfall_01.png');
        t_print = toc ();
        fprintf ('[%f %f] done\n',t_plot, t_print);
      end
      close ('all');
    else
      fprintf ('File "waterfall_01.png" already exists.\n');
    end
  catch
    fprintf ('ERROR in waterfall_01: %s\n', lasterr ());
    err_fid = fopen ('waterfall_01.err', 'w');
    fprintf (err_fid, '%s', lasterr ());
    fclose (err_fid);
  end

endfor

diary off
end

