Change parameter name in plotting scripts

Change the parameter `imagname` to `output` and provide `-o` shortcut.
This commit is contained in:
Benjamin Rosemann authored and David Peter committed 2021-02-16 08:21:45 +01:00
1 parent b04a9ec6c4
commit 49fcc4be37
3 files changed
+17 -9

No files matched your search

+6 -3
View File
@@ -17,7 +17,10 @@ parser.add_argument("--bins", help="Number of bins (default: auto)")
parser.add_argument( parser.add_argument(
"--type", help="Type of histogram (*bar*, barstacked, step, stepfilled)" "--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() args = parser.parse_args()
with open(args.file) as f: with open(args.file) as f:
@@ -44,7 +47,7 @@ plt.xlabel("Time [s]")
if args.title: if args.title:
plt.title(args.title) plt.title(args.title)
if args.imgname: if args.output:
plt.savefig(args.imgname) plt.savefig(args.output)
else: else:
plt.show() plt.show()
+5 -3
View File
@@ -25,7 +25,9 @@ parser.add_argument(
parser.add_argument( parser.add_argument(
"--titles", help="Comma-separated list of titles for the plot legend" "--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() args = parser.parse_args()
if args.parameter_name is not None: if args.parameter_name is not None:
@@ -101,7 +103,7 @@ if args.log_x:
if args.titles: if args.titles:
plt.legend(args.titles.split(",")) plt.legend(args.titles.split(","))
if args.imgname: if args.output:
plt.savefig(args.imgname) plt.savefig(args.output)
else: else:
plt.show() plt.show()
+6 -3
View File
@@ -18,7 +18,10 @@ parser.add_argument("--title", help="Plot Title")
parser.add_argument( parser.add_argument(
"--labels", help="Comma-separated list of entries for the plot legend" "--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() args = parser.parse_args()
with open(args.file) as f: 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.legend(handles=boxplot["boxes"], labels=labels, loc="best", fontsize="medium")
plt.ylabel("Time [s]") plt.ylabel("Time [s]")
plt.ylim(0, None) plt.ylim(0, None)
if args.imgname: if args.output:
plt.savefig(args.imgname) plt.savefig(args.output)
else: else:
plt.show() plt.show()