-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot_script.gp
More file actions
47 lines (37 loc) · 1.45 KB
/
Copy pathplot_script.gp
File metadata and controls
47 lines (37 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#----------------------------------------------------------------------
# This is an example gnuplot script to generate a basic performance
# comparison graph for CPSC 223. This example requires an "out.dat"
# file, which was generated by running:
#
# ./hw6perf 1 > out.dat
#
# To run this script type the following at the command line
#
# gnuplot -c plot_script.gp infile testname outfile
#
# For example, to create the output for the add to end test above, run
# the following from the command line
#
# gnuplot -c plot_script.gp "out.dat" "Add" "add.png"
#
#----------------------------------------------------------------------
infile = ARG1
testname = ARG2
outfile = ARG3
# Set the terminal for PNG output and aspect ratio
set terminal pngcairo enhanced font 'Verdana, 10'
set size ratio 0.75
# Save the graph in the given file name (e.g., "add_end.png")
set output outfile
# Set the title and each axis label
set title "Collection Implementation " . testname . " Performance"
set xlabel "Input Size (n)"
set ylabel "Time (milliseconds)"
# Move the key to the left of the graph
set key left
# Plot the data
plot infile u 1:2 t "ArrayList Collection" w linespoints pointtype 7, \
infile u 1:3 t "BinSearch Collection" w linespoints pointtype 7, \
infile u 1:4 t "HashTable Collection" w linespoints pointtype 7, \
infile u 1:5 t "BST Collection" w linespoints pointtype 7, \
infile u 1:6 t "AVL Collection" w linespoints pointtype 7