From f6b6c83ef7620de8e1bcb2cb4924e1ec70688929 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Mon, 24 Feb 2020 15:00:07 +0100 Subject: don't use data using filecontents* The filecontent is written to disk an may colide with the data from other plots. --- src/plots.py | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/src/plots.py b/src/plots.py index 2b2193d..4b849d3 100644 --- a/src/plots.py +++ b/src/plots.py @@ -527,23 +527,6 @@ def pgfplot(bench, perms, xexpr, yexpr, axis_attr=None, bar=False, """ for alloc_name, alloc_dict in allocators.items(): - tex += f"\\begin{{filecontents*}}{{{alloc_name}.dat}}\n" - tex += "x y" - if error_bars: - tex += " error" - tex += "\n" - - for perm in perms: - xval = _eval_with_stat(bench, xexpr, alloc_name, perm, "mean") - yval = _eval_with_stat(bench, yexpr, alloc_name, perm, "mean") - tex += f"{xval} {yval}" - if error_bars: - error = _eval_with_stat(bench, yexpr, alloc_name, perm, "std") - tex += f" {error}" - tex += "\n" - - tex += "\\end{filecontents*}\n" - # define color rgb = matplotlib.colors.to_rgb(_get_alloc_color(bench, alloc_dict)) tex += f"\\providecolor{{{alloc_name}-color}}{{rgb}}{{{rgb[0]},{rgb[1]},{rgb[2]}}}\n" @@ -579,7 +562,22 @@ f""" tex += f"] table" if error_bars: tex += "[y error=error]" - tex += f" {{{alloc_name}.dat}};\n" + + tex += " {\nx y" + if error_bars: + tex += " error" + tex += "\n" + + for perm in perms: + xval = _eval_with_stat(bench, xexpr, alloc_name, perm, "mean") + yval = _eval_with_stat(bench, yexpr, alloc_name, perm, "mean") + tex += f"{xval} {yval}" + if error_bars: + error = _eval_with_stat(bench, yexpr, alloc_name, perm, "std") + tex += f" {error}" + tex += "\n" + + tex += "};\n" tex +=\ """\\end{axis} -- cgit v1.2.3