diff options
author | Birte Kristina Friesel <birte.friesel@uos.de> | 2023-12-01 13:50:25 +0100 |
---|---|---|
committer | Birte Kristina Friesel <birte.friesel@uos.de> | 2023-12-01 13:50:25 +0100 |
commit | d88766b15c82f35b977e3313090fe4c061db2173 (patch) | |
tree | 91980ee38c8a8bde47dbae20ce92cfbe1bbd134b | |
parent | 8221f091eaae2900987eace290f117475561a74d (diff) |
analyze-log: add --boxplot-unparam support
-rwxr-xr-x | bin/analyze-log.py | 16 | ||||
-rw-r--r-- | lib/cli.py | 6 | ||||
-rwxr-xr-x | lib/plotter.py | 2 |
3 files changed, 23 insertions, 1 deletions
diff --git a/bin/analyze-log.py b/bin/analyze-log.py index 3538a98..f833b22 100755 --- a/bin/analyze-log.py +++ b/bin/analyze-log.py @@ -179,6 +179,22 @@ def main(): # output=fname, ) + if args.boxplot_unparam: + for name in model.names: + attr_names = sorted(model.attributes(name)) + dfatool.plotter.boxplot( + attr_names, + [model.by_name[name][attr] for attr in attr_names], + xlabel="Attribute", + output=f"{args.boxplot_unparam}{name}.pdf", + ) + for attribute in attr_names: + dfatool.plotter.boxplot( + [attribute], + [model.by_name[name][attribute]], + output=f"{args.boxplot_unparam}{name}-{attribute}.pdf", + ) + if args.cross_validate: xv_method, xv_count = args.cross_validate.split(":") xv_count = int(xv_count) @@ -258,6 +258,12 @@ def add_standard_arguments(parser): help="Limit precision of dataref export to NDIG decimals", ) parser.add_argument( + "--boxplot-unparam", + metavar="PREFIX", + type=str, + help="Export boxplots of raw (parameter-independent) observations to {PREFIX}{name}-{attribute}.pdf", + ) + parser.add_argument( "--export-xv", metavar="FILE", type=str, diff --git a/lib/plotter.py b/lib/plotter.py index 9d6f7ec..78f3f90 100755 --- a/lib/plotter.py +++ b/lib/plotter.py @@ -332,7 +332,7 @@ def plot_param_fit( def boxplot(ticks, measurements, xlabel="", ylabel="", modeldata=None, output=None): fig, ax1 = plt.subplots(figsize=(10, 6)) - fig.canvas.set_window_title("DriverEval") + ax1.set_title("dfatool unparam") 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) |