aboutsummaryrefslogtreecommitdiff
path: root/src/plots.py
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fl.fischer@fau.de>2020-02-24 15:00:07 +0100
committerFlorian Fischer <florian.fl.fischer@fau.de>2020-02-24 15:00:07 +0100
commitf6b6c83ef7620de8e1bcb2cb4924e1ec70688929 (patch)
tree76500404743dacb1580983998a1efb42d5ca7411 /src/plots.py
parent9d5e88cc15dea30a8ad4ed5d95879c7719bf1d55 (diff)
downloadallocbench-f6b6c83ef7620de8e1bcb2cb4924e1ec70688929.tar.gz
allocbench-f6b6c83ef7620de8e1bcb2cb4924e1ec70688929.zip
don't use data using filecontents*
The filecontent is written to disk an may colide with the data from other plots.
Diffstat (limited to 'src/plots.py')
-rw-r--r--src/plots.py34
1 files 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}