Generating a pdf graph of your data
by Chris Coakley
Assume you have a sample1.dat
that looks like:
# n time
1 1
2 2
3 4
4 8
5 16
6 32
7 64
Also assume you have a sample2.dat
that looks like:
# n time
1 50
2 51
3 52
4 53
5 54
6 55
7 56
Create a file called gnuplottest.p
that looks like (there is no spelling error on styl):
set data styl linespoints
set output "sampleplot.ps"
set terminal postscript
plot "sample1.dat", "sample2.dat"
Create the plot using the command:
gnuplot < gnuplottest.p
And convert sampleplot.ps
to pdf using the command:
ps2pdf sampleplot.ps sampleplot.pdf
You may find the following links useful (In decreasing order of
utility):
Note that I am not an expert at gnuplot by any means, but I thought
that this tutorial would help with the Lab 1 assignment.