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 'symbols_distances.png'
74 my_title = "Relative symbol distances (receiver)\n" . \
75 sprintf("min call setup time %.2f s\n", call_setup_time_min) . \
76 sprintf("max call setup time %.2f s\n", call_setup_time_max) . \
77 sprintf("fixed inter call distance %.2f s\n", inter_call_distance)
79 set multiplot layout 2, 1 title my_title font "Georgia,14"
81 first_call_time = call_setup_time_max
82 second_call_time = call_setup_time_min
84 set title "Minimum distance between the first rings of two calls"
86 symbols_distances_data using (0):(0):(call_position):(call_position + call_time($16)):(0):(symbol_bar_height($0)):0 with boxxy \
87 fs solid noborder lc palette notitle, \
88 symbols_distances_data using ($20):(0.53):(get_val(strcol(22)) - $20):(0) with vectors arrowstyle 1 title 'receiver symbol window', \
89 symbols_distances_data using ($20):(0):(0):(0.55) with vectors arrowstyle 2 notitle, \
90 symbols_distances_data using ($20 + symbol_distance / 2):(0.55):(strcol(11)) with labels font "Courier,12" notitle, \
92 first_call_time = call_setup_time_min
93 second_call_time = call_setup_time_max
95 set title "Maximum distance between the first rings of two calls"