diff options
-rwxr-xr-x | bin/analyze-log.py | 7 | ||||
-rwxr-xr-x | lib/plotter.py | 14 |
2 files changed, 19 insertions, 2 deletions
diff --git a/bin/analyze-log.py b/bin/analyze-log.py index 0244ec8..0ea7921 100755 --- a/bin/analyze-log.py +++ b/bin/analyze-log.py @@ -150,6 +150,11 @@ def main(): ) if args.boxplot_unparam: + title_suffix = None + if args.filter_param: + title_suffix = "filter: " + ", ".join( + map(lambda kv: f"{kv[0]}={kv[1]}", args.filter_param) + ) for name in model.names: attr_names = sorted(model.attributes(name)) dfatool.plotter.boxplot( @@ -157,6 +162,7 @@ def main(): [model.by_name[name][attr] for attr in attr_names], xlabel="Attribute", output=f"{args.boxplot_unparam}{name}.pdf", + title_suffix=title_suffix, show=not args.non_interactive, ) for attribute in attr_names: @@ -164,6 +170,7 @@ def main(): [attribute], [model.by_name[name][attribute]], output=f"{args.boxplot_unparam}{name}-{attribute}.pdf", + title_suffix=title_suffix, show=not args.non_interactive, ) diff --git a/lib/plotter.py b/lib/plotter.py index 7ec96b3..5fa44ee 100755 --- a/lib/plotter.py +++ b/lib/plotter.py @@ -339,10 +339,20 @@ def plot_param_fit( def boxplot( - ticks, measurements, xlabel="", ylabel="", modeldata=None, output=None, show=True + ticks, + measurements, + xlabel="", + ylabel="", + modeldata=None, + output=None, + show=True, + title_suffix=None, ): fig, ax1 = plt.subplots(figsize=(10, 6)) - ax1.set_title(f"dfatool unparam (n={len(measurements[0])})") + if title_suffix: + ax1.set_title(f"dfatool unparam (n={len(measurements[0])}, {title_suffix})") + else: + ax1.set_title(f"dfatool unparam (n={len(measurements[0])})") plt.subplots_adjust(left=0.1, right=0.95, top=0.95, bottom=0.1) bp = plt.boxplot(measurements, notch=0, sym="+", vert=1, whis=1.5) |