Thibaut Démare
LITIS - Université du Havre
March 29th, 2016
set terminal [options]
set output [options]
it defines the output format.set xrange [options]
set yrange [options]
it defines the ranges of the function to plot.plot [options]
the main command which draws the function or data.plot sin(x)
to plot a classic math function.plot "data.txt" using 1:2
to plot data from a CSV file.plot "data.txt" using 1:5 title 'My data' with linespoints linewidth 2 pointinterval -100
pointtype 13 pointsize 1 linecolor rgb "#228B22"
a more customized version.
# First, we tell to gnuplot what it the output
# Here, it is a SVG file called "output.svg", with a "times new roman" font
set terminal svg size 1473,824 enhanced fname 'Times New Roman' fsize 24 butt solid
set output 'output.svg'
# We define where to place the legend
set key inside bottom right
# Put a title to the x-axis
set xlabel 'Time'
# And a title to the y-axis
set ylabel 'Number of Logistics Service Provider'
# And the main title
set title 'Strategies Adoption'
# Eventually we plot the four curves
plot "data.txt" using 1:5 title 'Strategy 1' with linespoints lw 2 pi -100 pt 13 ps 1 lc rgb "#228B22",\
"data.txt" using 1:4 title 'Strategy 2' with linespoints lw 2 pi -100 pt 9 ps 1 lc rgb "#FF8C00",\
"data.txt" using 1:2 title 'Strategy 3' with linespoints lw 2 pi -100 pt 11 ps 1 lc rgb "#003B6F",\
"data.txt" using 1:3 title 'Strategy 4' with linespoints lw 2 pi -100 pt 7 ps 1 lc rgb "#CC0000"
thibaut.demare@univ-lehavre.fr