# Example of simple graph plotting using gnuplot on Linux set terminal postscript # plot the pmf/pdf data points from buckets.c to see what they look like set output 'pdf.ps' set title "Histogram (pmf/pdf) of Bucketed Data" set xlabel 'Bucket' set ylabel 'Relative Frequency' plot [0:][0:] 'buckets.dat' using 2:4 notitle with boxes # plot the CDF of data points from buckets.c to see what it looks like set output 'CDF.ps' set title "Cumulative Distribution Function (CDF) of Bucketed Data" set xlabel 'Bucket' set ylabel 'Cumulative Frequency' plot [0:][0:] 'buckets.dat' using 2:5 notitle with lines # plot the data points from autocorr.c to look at autocorrelation set output 'autocorr.ps' set title "Autocorrelation Function" set xlabel 'Lag' set ylabel 'Autocorrelation Coefficient' plot [0:][-1:1] 0 notitle with lines, 'autocorr.dat' using 1:2 notitle with linespoints # plot the CDF of data points from qq.c to see what it looks like set output 'qq1.ps' set title "Cumulative Distribution Function (CDF)" set xlabel 'Data Value' set ylabel 'Cumulative Probability' plot [0:][0:] 'qq.dat' using 1:2 notitle with lines # plot the CDF from qq.c and sample data CDF to see how it looks set output 'qq2.ps' set title "Cumulative Distribution Function (CDF)" set xlabel 'Data Value' set ylabel 'Cumulative Probability' set key bottom right plot [0:][0:] 'buckets.dat' using 2:5 title "Data CDF" with lines 2, 'qq.dat' using 1:2 title "Model CDF" with lines 1 # plot the model values from qq.c and sample data values to see how it looks set output 'qq3.ps' set title "Q-Q Plot" set xlabel 'Model Data Value' set ylabel 'Sample Data Value' plot [0:][0:] 'qq2.dat' using 1:3 notitle with points # plot the CDF qq2.c and the emperical CDF to see how it looks set output 'qq4.ps' set title "Comparison of Empirical and Model CDF" set xlabel 'Data Value' set ylabel 'Cumulative Probability' plot [0:][0:] 'qq2.dat' using 1:2 title "Model" with lines, 'qq2.dat' using 3:4 title "Empirical" with lines # plot the doors.dat example from the slides to test for Normal fit set output 'doors.ps' set title "Q-Q Plot" set xlabel 'Model Data Value' set ylabel 'Sample Data Value' #plot [97:103][97:103] 'doors2.dat' using 2:1 notitle with points plot [97:103][97:103] 0.994482*x+0.551950 title "Regression Line" w l, 'doors2.dat' using 2:1 with points # plot the heights and weights to look for correlation set output 'heights.ps' set title "Heights and Weights of Randomly Generated People" set xlabel 'Weight (kg)' set ylabel 'Height (cm)' plot [][] 0.538*x+128 with lines, 'heights.dat' using 2:1 notitle with points #plot [][] 'heights.dat' using 2:1 notitle with points # plot some numbers versus time as a time series plot set output 'numbers.ps' set title "Time Series Plot" set xlabel 'Time Step' set ylabel 'Data Value' plot [0:][0:] 'numbers.dat' using 1 notitle with lines # plot the queue size versus time set output 'queue.ps' set title "Queue Size versus Time" set xlabel 'Time in Minutes' set ylabel 'Queue Size' plot [0:][0:] 'queue.dat' using 1:2 notitle with impulses # plot the event list size versus time set output 'events.ps' set title "Event List Size versus Time" set xlabel 'Time in Minutes' set ylabel 'Event List Size' plot [0:][0:] 'events.dat' using 1:2 notitle with lines # plot the Banff car queue size versus time set output 'queue.ps' set title "Queue Size versus Time" set xlabel 'Time in Minutes' set ylabel 'Queue Size' plot [0:][0:] 'trace1.dat' using 1:2 with lines # plot the Banff car queue validation results set output 'mm1val-10reps.ps' set title "M/M/1 Validation Results: Mean Queue Size versus Load" set xlabel 'Offered Load (rho)' set ylabel 'Mean Queue Size' set key top left plot [0.7:][0:] x/(1-x) title 'Analysis' with lines, \ 'queue-10reps.dat' using 1:2 title 'Simulation' with points 2, \ 'queue-10reps.dat' using 1:2:5 title '95% Confidence Interval' with yerrorbars 2 # 'queue-10reps.dat' using 1:2:3 title 'Standard Deviation' with yerrorbars # 'queue-10reps.dat' using 1:2:4 title '90% Confidence Interval' with yerrorbars # 'queue-10reps.dat' using 1:2:5 title '95% Confidence Interval' with yerrorbars # plot the Banff car queue comparison results set output 'compare.ps' set title "Banff Park Entry Gate Simulation Results: Mean Queue Size versus Load" set xlabel 'Offered Load (rho)' set ylabel 'Mean Queue Size' set key top left plot [0.7:][0:] x/(1-x) title 'M/M/1 Analysis' with lines, \ 'queue-10reps.dat' using 1:2 title 'M/M/1 Simulation' with points 2, \ 'queue-10reps.dat' using 1:2:4 title '90% Confidence Interval' with yerrorbars 2, \ ((x/(1-x)) - x*x/(2*(1-x))) title 'M/D/1 Analysis' with lines, \ 'dqueue-10reps.dat' using 1:2 title 'M/D/1 Simulation' with points 1, \ 'dqueue-10reps.dat' using 1:2:4 title '90% Confidence Interval' with yerrorbars 1 # plot the Banff car queue comparison results set output 'compare3.ps' set title "Banff Park Entry Gate Simulation Results: Mean Queue Size versus Load" set xlabel 'Offered Load (rho)' set ylabel 'Mean Queue Size' set key top left plot [0.7:][0:] x + 1.1*x*x/(1-x) title 'M/G/1 Analysis' with lines, \ 'hqueue-10reps.dat' using 1:2 title 'M/G/1 Simulation' with points 3, \ 'hqueue-10reps.dat' using 1:2:4 title '90% Confidence Interval' with yerrorbars 3, \ x/(1-x) title 'M/M/1 Analysis' with lines, \ 'queue-10reps.dat' using 1:2 title 'M/M/1 Simulation' with points 2, \ 'queue-10reps.dat' using 1:2:4 title '90% Confidence Interval' with yerrorbars 2, \ ((x/(1-x)) - x*x/(2*(1-x))) title 'M/D/1 Analysis' with lines, \ 'dqueue-10reps.dat' using 1:2 title 'M/D/1 Simulation' with points 1, \ 'dqueue-10reps.dat' using 1:2:4 title '90% Confidence Interval' with yerrorbars 1 # show what positive correlation, negative correlation, and uncorrelated look like set title "Scatterplot of IAT and Service Times" set output "ind.ps" set xlabel 'Service Time' set ylabel 'Inter-Arrival Time' plot [0:][0:] 'ind.dat' with boxes set output "pos.ps" plot [0:][0:] 'pos.dat' with points set output "neg.ps" plot [0:][0:] 'neg.dat' with points set output "neglog.ps" set logscale x plot [0.01:][0.01:] 'neg.dat' with points set nologscale x # draw the call occupancy distribution set output 'callpdf.ps' set title "Call Occupancy Distribution" set xlabel 'Number of Calls in System' set ylabel 'Probability' set boxwidth 1 plot [0:][0:] 'callpdf.dat' using 1:2 notitle with boxes # draw the call occupancy profile time series set output 'calls.ps' set title "Call Occupancy versus Time" set xlabel 'Time in Minutes' set ytics 1 set ylabel 'Number of Calls in System' plot [0:][0:] 'calls.dat' using 1:2 notitle with lines