diff options
Diffstat (limited to 'plot_rtas12_betaexp.py')
| -rwxr-xr-x | plot_rtas12_betaexp.py | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/plot_rtas12_betaexp.py b/plot_rtas12_betaexp.py index 2153222..88be801 100755 --- a/plot_rtas12_betaexp.py +++ b/plot_rtas12_betaexp.py | |||
| @@ -49,10 +49,15 @@ def set_plot_opts(opts, p): | |||
| 49 | if opts.paper: | 49 | if opts.paper: |
| 50 | ext = 'pdf' | 50 | ext = 'pdf' |
| 51 | p.size = ('8.5cm', '5.25cm') | 51 | p.size = ('8.5cm', '5.25cm') |
| 52 | line_width = 1.5 | ||
| 53 | point_size = 0.3 | ||
| 52 | p.font_size = '5pt' | 54 | p.font_size = '5pt' |
| 53 | else: | 55 | else: |
| 54 | ext = 'png' | 56 | ext = 'png' |
| 55 | p.size = (1024, 768) | 57 | p.size = (1024, 768) |
| 58 | line_width = 3.0 | ||
| 59 | point_size = 1.5 | ||
| 60 | p.font_size = 'font "/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf" 18' | ||
| 56 | p.output = '{0}.{1}'.format(p.output, ext) | 61 | p.output = '{0}.{1}'.format(p.output, ext) |
| 57 | p.format = ext | 62 | p.format = ext |
| 58 | p.default_style = 'linespoints lw 2.5' | 63 | p.default_style = 'linespoints lw 2.5' |
| @@ -61,15 +66,17 @@ def set_plot_opts(opts, p): | |||
| 61 | p.ylog = True | 66 | p.ylog = True |
| 62 | p.key = 'off' | 67 | p.key = 'off' |
| 63 | 68 | ||
| 64 | p.line_styles = [(1, "lw 1.5 ps 0.4"), | 69 | p.line_styles = [ |
| 65 | (2, "lw 1.5 ps 0.4"), | 70 | (1, "lw {0} ps {1}".format(line_width, point_size)), |
| 66 | (3, "lw 1.5 ps 0.4"), | 71 | (2, "lw {0} ps {1}".format(line_width, point_size)), |
| 67 | (4, "lw 1.5 ps 0.4")] | 72 | (3, "lw {0} ps {1}".format(line_width, point_size)), |
| 73 | (4, "lw {0} ps {1}".format(line_width, point_size))] | ||
| 74 | |||
| 68 | for i, c in enumerate(p.curves): | 75 | for i, c in enumerate(p.curves): |
| 69 | c.style = "linespoints ls %d" % (i + 1) | 76 | c.style = "linespoints ls %d" % (i + 1) |
| 70 | 77 | ||
| 71 | 78 | ||
| 72 | def plot_metric(opts, dat_dir, metric, coin_prob, xr=None): | 79 | def plot_metric(opts, dat_dir, metric, coin_prob, xr=None, for_jim=False): |
| 73 | """Plot metric for each level, enforcement pair at the specified | 80 | """Plot metric for each level, enforcement pair at the specified |
| 74 | probability. | 81 | probability. |
| 75 | 82 | ||
| @@ -79,7 +86,9 @@ def plot_metric(opts, dat_dir, metric, coin_prob, xr=None): | |||
| 79 | p.output = '{0}/beta-exp-metric={1}-prob={2}'.format( | 86 | p.output = '{0}/beta-exp-metric={1}-prob={2}'.format( |
| 80 | dat_dir, metric, str(coin_prob).replace('.', '')) | 87 | dat_dir, metric, str(coin_prob).replace('.', '')) |
| 81 | if xr is not None: | 88 | if xr is not None: |
| 82 | p.output = '{0}-zoom=1'.format(p.output) | 89 | p.output = '{0}_zoom=1'.format(p.output) |
| 90 | if for_jim: | ||
| 91 | p.output = '{0}-forjim=1'.format(p.output) | ||
| 83 | 92 | ||
| 84 | for (level, enforcement) in [(l, e) for l in ('c', 'b') for e in (1, 0)]: | 93 | for (level, enforcement) in [(l, e) for l in ('c', 'b') for e in (1, 0)]: |
| 85 | fname = '{0}/beta_be={1}_prob={2}.csv'.format(dat_dir, enforcement, coin_prob) | 94 | fname = '{0}/beta_be={1}_prob={2}.csv'.format(dat_dir, enforcement, coin_prob) |
| @@ -102,6 +111,12 @@ def plot_metric(opts, dat_dir, metric, coin_prob, xr=None): | |||
| 102 | p.yrange = (-0.01, 1.01) | 111 | p.yrange = (-0.01, 1.01) |
| 103 | if (metric == 'rel-rt-mean' and coin_prob == 0.1 and xr is None): | 112 | if (metric == 'rel-rt-mean' and coin_prob == 0.1 and xr is None): |
| 104 | p.key = 'at 1, 100' | 113 | p.key = 'at 1, 100' |
| 114 | |||
| 115 | if for_jim: | ||
| 116 | p.title = 'relative response time mean, 10% abberant' | ||
| 117 | p.key = 'top left' | ||
| 118 | if xr is None: | ||
| 119 | p.key = 'at 1, 10' | ||
| 105 | p.gnuplot_exec() | 120 | p.gnuplot_exec() |
| 106 | 121 | ||
| 107 | def main(): | 122 | def main(): |
| @@ -122,5 +137,9 @@ def main(): | |||
| 122 | # not in paper | 137 | # not in paper |
| 123 | plot_metric(opts, data_dir, 'rel-rt-max', coin_val) | 138 | plot_metric(opts, data_dir, 'rel-rt-max', coin_val) |
| 124 | 139 | ||
| 140 | # for jim | ||
| 141 | plot_metric(opts, data_dir, 'rel-rt-mean', 0.1, for_jim=True) | ||
| 142 | plot_metric(opts, data_dir, 'rel-rt-mean', 0.1, xr=(0.02, 0.11), for_jim=True) | ||
| 143 | |||
| 125 | if __name__ == '__main__': | 144 | if __name__ == '__main__': |
| 126 | main() | 145 | main() |
