#!/usr/bin/perl 
my$plot1="blast.txt";  #insert name for blast outputfile in m8 format
my$plot2="blastTopHit.txt"; #insert name for blast outputfile containing only top hits
open (PLOT,">temp.p");

#print PLOT 'set terminal postscript enhanced  color 20;'."\n";
print PLOT 'set terminal png size 1200,1200 ;'."\n";
#print PLOT "set terminal postscript landscape color 20;\n";
print PLOT 'set out "plot.png";'."\n"; #you might need to change the extension to ps if you change the above

print PLOT 'set pointsize .2;'."\n";

print PLOT 'set xtic rotate;'."\n"; #prints xtic labels at 90 degree
#print PLOT 'set xrange [0:2.1e+6];';  #if you want to specify a range, e.g., you have multiple comparisons that all should have the same scale
#print PLOT 'set yrange [0:2.3e+6];';

print PLOT "plot ".'"'."$plot1".'" using 2:1 with points ls 2,'.'"'."$plot2".'" using 2:1 with points ls 1;'."\n"; 

close (PLOT);

system "gnuplot temp.p";

exit;
