1 #!/usr/bin/gnuplot -persist
5 # Version 5.0 patchlevel 1 last modified 2015-06-07
7 # Copyright (C) 1986-1993, 1998, 2004, 2007-2015
8 # Thomas Williams, Colin Kelley and many others
10 # gnuplot home: http://www.gnuplot.info
11 # faq, bugs, etc: type "help FAQ"
12 # immediate help: type "help" (plot window: hit 'h')
16 set key autotitles nobox reverse Left enhanced vert left at graph 0, screen 0.98
21 set xtics 5 out nomirror rotate by -45
27 set style arrow 1 heads fill size screen .02,15 lc 'gray'
28 set style arrow 2 nohead lc 'gray'
34 max(a, b) = (a > b) ? a : b
36 symbols_distances_data = 'symbols_distances_defaults.log'
39 #symbols_distances_data = 'symbols_distances_optimistic.log'
40 #symbols_distances_data = 'symbols_distances_codex.log'
41 #symbols_distances_data = 'symbols_distances_savemysugar.log'
45 plot symbols_distances_data using 7:9
46 call_setup_time_min = GPVAL_DATA_X_MAX
47 call_setup_time_max = GPVAL_DATA_Y_MAX
49 plot symbols_distances_data using 0:20
50 num_symbols = GPVAL_DATA_X_MAX + 1
51 dot_distance_min = GPVAL_DATA_Y_MIN
52 EOM_distance_min = GPVAL_DATA_Y_MAX
54 plot symbols_distances_data using 0:16
55 symbol_distance_min = GPVAL_DATA_X_MIN
56 inter_call_distance = GPVAL_DATA_Y_MIN
58 symbol_distance = 2 * (call_setup_time_max - call_setup_time_min)
59 call_position = dot_distance_min - inter_call_distance
61 max_x = EOM_distance_min + symbol_distance
63 get_val(val) = val eq "inf" ? max_x : val
64 call_time(sym_dist) = abs(call_setup_time_max - first_call_time) + sym_dist + abs(second_call_time - call_setup_time_min)
65 symbol_bar_height(val) = (num_symbols - $0) / (2 * num_symbols)
67 set xrange [0:max_x + 3]
70 set terminal qt 0 enhanced font "Georgia,14" size _w,_h
71 #set terminal pngcairo notransparent nocrop truecolor rounded enhanced font "Georgia,14" fontscale 1.0 size _w,_h
72 #set output 'pulse_distance_modulation.png'
74 set multiplot layout 2, 1 title "Relative symbol distances (receiver)" font "Georgia,14"
76 first_call_time = call_setup_time_max
77 second_call_time = call_setup_time_min
79 set title "Minimum call distance"
81 symbols_distances_data using (0):(0):(call_position):(call_position + call_time($16)):(0):(symbol_bar_height($0)):0 with boxxy \
82 fs solid noborder lc palette notitle, \
83 symbols_distances_data using ($20):(0.53):(get_val(strcol(22)) - $20):(0) with vectors arrowstyle 1 title 'receiver symbol interval', \
84 symbols_distances_data using ($20):(0):(0):(0.55) with vectors arrowstyle 2 notitle, \
85 symbols_distances_data using ($20 + symbol_distance / 2):(0.55):(strcol(11)) with labels font "Courier,12" notitle, \
87 first_call_time = call_setup_time_min
88 second_call_time = call_setup_time_max
90 set title "Maximum call distance"