Skip to content
Myr

Change parameter name in plotting scripts

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Change the parameter `imagname` to `output` and provide `-o` shortcut.

authored by Benjamin Rosemann · committed by David Peter · parent b04a9ec · Browse files · 3 files+17 added−9 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+17 added−9 removed

  • other:+17 added−9 removed

3 files+17 added−9 removed

modified:scripts/plot_histogram.py+6 added-3 removed
15 unmodified lines
16parser.add_argument("--bins", help="Number of bins (default: auto)")17parser.add_argument(18 "--type", help="Type of histogram (*bar*, barstacked, step, stepfilled)"19)20parser.add_argument("--imgname", help="Save image to the given filename.")20parser.add_argument(21 "-o", "--output", help="Save image to the given filename."22)2324args = parser.parse_args()2526with open(args.file) as f:27 results = json.load(f)["results"]
18 unmodified lines
46plt.xlabel("Time [s]")47if args.title:48 plt.title(args.title)4947if args.imgname:48 plt.savefig(args.imgname)50if args.output:51 plt.savefig(args.output)52else:53 plt.show()
modified:scripts/plot_parametrized.py+5 added-3 removed
23 unmodified lines
24)25parser.add_argument(26 "--titles", help="Comma-separated list of titles for the plot legend"27)28parser.add_argument("--imgname", help="Save image to the given filename.")28parser.add_argument(29 "-o", "--output", help="Save image to the given filename."30)3132args = parser.parse_args()33if args.parameter_name is not None:34 sys.stderr.write(
67 unmodified lines
102103if args.titles:104 plt.legend(args.titles.split(","))105104if args.imgname:105 plt.savefig(args.imgname)106if args.output:107 plt.savefig(args.output)108else:109 plt.show()
modified:scripts/plot_whisker.py+6 added-3 removed
16 unmodified lines
17parser.add_argument("--title", help="Plot Title")18parser.add_argument(19 "--labels", help="Comma-separated list of entries for the plot legend"20)21parser.add_argument("--imgname", help="Save image to the given filename.")21parser.add_argument(22 "-o", "--output", help="Save image to the given filename."23)2425args = parser.parse_args()2627with open(args.file) as f:28 results = json.load(f)["results"]
15 unmodified lines
44 plt.title(args.title)45plt.legend(handles=boxplot["boxes"], labels=labels, loc="best", fontsize="medium")46plt.ylabel("Time [s]")47plt.ylim(0, None)45if args.imgname:46 plt.savefig(args.imgname)48if args.output:49 plt.savefig(args.output)50else:51 plt.show()