Gnuplot: Plotting graphs

From Define Wiki
Jump to navigation Jump to search

Simple example plotting the performance of gromacs. Two files each with two columns (step / ns/day). Commands below plot the performance over execution time.

gnuplot> set title "Hinditron Gromacs Tests" 
gnuplot> set xlabel "Step"
gnuplot> set ylabel "ns/day"
gnuplot> plot 'amd.gunplot.dat' using 1:2 title "AMD 6274", './intel.gnuplot.dat' using 1:2 title "Intel E5-2670"
gnuplot> set terminal postscript portrait enhanced color dashed lw 1 "DejaVuSans" 12
Terminal type set to 'postscript'
Options are 'portrait enhanced defaultplex \
   leveldefault color colortext \
   dashed dashlength 1.0 linewidth 1.0 butt noclip \
   palfuncparam 2000,0.003 \
   "DejaVuSans" 12 '
gnuplot> set output "gromacs-graph.ps"
gnuplot> replot
gnuplot> exit

# Alternative output, print to jpeg file:
gnuplot> set terminal jpeg
Terminal type set to 'jpeg'
Options are 'nocrop font /usr/share/fonts/truetype/ttf-liberation/LiberationSans-Regular.ttf 12 size 640,480 '
gnuplot> set output 'graph.jpeg'
gnuplot> plot 'amd.gunplot.dat' using 1:2 title "AMD 6274", './intel.gnuplot.dat' using 1:2 title "Intel E5-2670"