% printPngPlot
function printPngPlot ( nameString, printPlots, verticalView )

if ( nargin == 2 )
  verticalView = 0; 
end

if printPlots
  zoomNameString = ['ZOOM' nameString];

  % A 20" LCD monitor has dimensions 16" width x 12" height. If the
  % resolution is set to 1280x1024, then there are 1280 pixels per 16
  % inches or 80 pixels per inch. Set the halfWidth image size to 75
  % pixels per inch, so that when the image is displayed it will be a
  % bit smaller than half the screen width. Similarly, set the
  % fullWidth image size to 180 pixels per inch. 
  % 
  %   halfWidth = '-r75'; % pixels per inch
  %   fullWidth = '-r180'; % pixels per inch
  %  
  % For a 20" LCD monitor with resolution set to 1600x1200, there
  % are 100 pixels per inch. Set the halfWidth image size to 95
  % pixels per inch, and the fullWidth image size to 200 pixels per
  % inch. 
  halfWidth = '-r95';
  fullWidth = '-r200';
  
  if ( verticalView )
    zoomPaperPosition; 
    print('-dpng', halfWidth, nameString);
  else
    print('-dpng', halfWidth, nameString);
    zoomPaperPosition;
  end
  
  print('-dpng',fullWidth, zoomNameString);
end


end


function zoomPaperPosition
paperPosition = get ( gcf, 'PaperPosition' );
paperPosition(3) = paperPosition(3)*2;
paperPosition(4) = paperPosition(4)*2;
set(gcf, 'PaperPosition', paperPosition);
end