#!/usr/bin/perl


sub fix_plot {

  my($InStub) = shift(@_);
  my($OutFile) = "Temp_plot.agr";
  my($InFile) = $InStub . ".agr";

  my($ThisLine);
  open(INFILE, '<', $InFile) or die "Cannot open data file";
  open(OUTFILE, '>', $OutFile) or die "Cannot open output file";
  while (<INFILE>){
     $ThisLine = $_;                    # this is the next line in the input file
     $ThisLine =~ s/tick minor ticks 4/tick minor ticks 3/g; # substitution
     print OUTFILE $ThisLine;
     }
  close(INFILE);
  close(OUTFILE);

  system("mv -f $OutFile $InFile");
  system("xmgrace -hdevice EPS -printfile $InStub.eps -hardcopy $InStub.agr");
  system("rm -f $InStub.gif");
  system("ps2gif $InStub");
  
}

# **********************************************************************


fix_plot("Ag");                
fix_plot("Ag_gap");            
fix_plot("Agp");               
fix_plot("Agp_gap");           
fix_plot("Agpp");              
fix_plot("Agpp_gap");          
fix_plot("Agpp_Rinv_gap");     
fix_plot("Agpp_string_plot");  
fix_plot("Agp_Rinv_gap");      
fix_plot("Agp_string_plot");   
fix_plot("Ag_Rinv_gap");       
fix_plot("Ag_string_plot");    
fix_plot("Au");                
fix_plot("Au_gap");            
fix_plot("Aup");              
fix_plot("Aup_gap");          
fix_plot("Aupp");             
fix_plot("Aupp_gap");         
fix_plot("Aupp_Rinv_gap");    
fix_plot("Aupp_string_plot"); 
fix_plot("Aup_Rinv_gap");     
fix_plot("Aup_string_plot");  
fix_plot("Au_Rinv_gap");      
fix_plot("Au_string_plot");   
fix_plot("Sg");               
fix_plot("Sgp");              
fix_plot("Sgp_gap");          
fix_plot("Sgpp");
fix_plot("Sgpp_gap");
fix_plot("Sgppp");
fix_plot("Sgppp_gap");
fix_plot("Sgppp_Rinv_gap");
fix_plot("Sgppp_string_plot");
fix_plot("Sgpp_Rinv_gap");
fix_plot("Sgpp_string_plot");
fix_plot("Sgp_Rinv_gap");
fix_plot("Sgp_string_plot");
fix_plot("Su");
fix_plot("Su_gap");
fix_plot("Su_Rinv_gap");
fix_plot("Su_string_plot");

exit;








