From 49fcc4be37f1e02ff4e5b24cae34e2e0aaae89f4 Mon Sep 17 00:00:00 2001 From: Benjamin Rosemann Date: Tue, 16 Feb 2021 08:02:11 +0100 Subject: [PATCH] Change parameter name in plotting scripts Change the parameter `imagname` to `output` and provide `-o` shortcut. --- scripts/plot_histogram.py | 9 ++++++--- scripts/plot_parametrized.py | 8 +++++--- scripts/plot_whisker.py | 9 ++++++--- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/scripts/plot_histogram.py b/scripts/plot_histogram.py index 62726f2..6b47cfa 100755 --- a/scripts/plot_histogram.py +++ b/scripts/plot_histogram.py @@ -17,7 +17,10 @@ parser.add_argument("--bins", help="Number of bins (default: auto)") parser.add_argument( "--type", help="Type of histogram (*bar*, barstacked, step, stepfilled)" ) -parser.add_argument("--imgname", help="Save image to the given filename.") +parser.add_argument( + "-o", "--output", help="Save image to the given filename." +) + args = parser.parse_args() with open(args.file) as f: @@ -44,7 +47,7 @@ plt.xlabel("Time [s]") if args.title: plt.title(args.title) -if args.imgname: - plt.savefig(args.imgname) +if args.output: + plt.savefig(args.output) else: plt.show() diff --git a/scripts/plot_parametrized.py b/scripts/plot_parametrized.py index d913c67..fce54de 100755 --- a/scripts/plot_parametrized.py +++ b/scripts/plot_parametrized.py @@ -25,7 +25,9 @@ parser.add_argument( parser.add_argument( "--titles", help="Comma-separated list of titles for the plot legend" ) -parser.add_argument("--imgname", help="Save image to the given filename.") +parser.add_argument( + "-o", "--output", help="Save image to the given filename." +) args = parser.parse_args() if args.parameter_name is not None: @@ -101,7 +103,7 @@ if args.log_x: if args.titles: plt.legend(args.titles.split(",")) -if args.imgname: - plt.savefig(args.imgname) +if args.output: + plt.savefig(args.output) else: plt.show() diff --git a/scripts/plot_whisker.py b/scripts/plot_whisker.py index b320265..81d6e35 100755 --- a/scripts/plot_whisker.py +++ b/scripts/plot_whisker.py @@ -18,7 +18,10 @@ parser.add_argument("--title", help="Plot Title") parser.add_argument( "--labels", help="Comma-separated list of entries for the plot legend" ) -parser.add_argument("--imgname", help="Save image to the given filename.") +parser.add_argument( + "-o", "--output", help="Save image to the given filename." +) + args = parser.parse_args() with open(args.file) as f: @@ -42,7 +45,7 @@ if args.title: plt.legend(handles=boxplot["boxes"], labels=labels, loc="best", fontsize="medium") plt.ylabel("Time [s]") plt.ylim(0, None) -if args.imgname: - plt.savefig(args.imgname) +if args.output: + plt.savefig(args.output) else: plt.show()