aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fl.fischer@fau.de>2020-06-10 14:57:36 +0200
committerFlorian Fischer <florian.fl.fischer@fau.de>2020-06-10 15:00:05 +0200
commitd18439c8d66878045ad32db7a6882f384a647c33 (patch)
tree43b16932f1e3a0a445a5e27d7022f2044ec32ae5
parentbc67e478022a2909542d82e25099775a6a8c22fe (diff)
downloadallocbench-d18439c8d66878045ad32db7a6882f384a647c33.tar.gz
allocbench-d18439c8d66878045ad32db7a6882f384a647c33.zip
[plots.py] special case plot creation for benchmarks without arguments
-rw-r--r--allocbench/plots.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/allocbench/plots.py b/allocbench/plots.py
index b266ce2..6d24b04 100644
--- a/allocbench/plots.py
+++ b/allocbench/plots.py
@@ -378,6 +378,39 @@ def plot(bench,
x_args = x_args or args
+ # create plots for benchmarks without arguments
+ if not x_args:
+ fig_label = f'{bench.name}.{file_postfix}'
+ karg_plot_option = plot_options or {}
+ cur_plot_options = _create_plot_options(plot_type, **karg_plot_option)
+
+ cur_fig_options = {}
+
+ substitutions = vars()
+ substitutions.update(vars(bench))
+ for option, value in (fig_options or {}).items():
+ if isinstance(value, str):
+ cur_fig_options[option] = value.format(**substitutions)
+
+ cur_fig_options = _create_figure_options(plot_type, fig_label,
+ **cur_fig_options)
+
+ # plot specific defaults
+ cur_fig_options.setdefault("ylabel", y_expression)
+ cur_fig_options.setdefault("xlabel", "")
+ cur_fig_options.setdefault("titel", fig_label)
+
+ _plot(bench,
+ allocators,
+ y_expression, [""],
+ list(bench.iterate_args(args=args)),
+ plot_type,
+ cur_plot_options,
+ cur_fig_options,
+ scale=scale,
+ sumdir=sumdir,
+ file_ext=file_ext)
+
for loose_arg in x_args:
x_data = args[loose_arg]