Skip to content

Commit

Permalink
Allow to change output file name
Browse files Browse the repository at this point in the history
Add parameter -o --output to specify output file name (default still works)
  • Loading branch information
ondrejtichacek committed Jul 22, 2017
1 parent 03fb4a8 commit 7b7d10e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion examplescripts/pycorn-bin.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,10 @@ def plotterX(inp,fname):
host.yaxis.set_minor_locator(AutoMinorLocator())
if not args.no_title:
plt.title(fname, loc='left', size=9)
plot_file = fname[:-4] + "_" + inp.run_name + "_plot." + args.format
if not args.output:
plot_file = fname[:-4] + "_" + inp.run_name + "_plot." + args.format
else:
plot_file = args.output
plt.savefig(plot_file, bbox_inches='tight', dpi=args.dpi)
print("Plot saved to: " + plot_file)
plt.clf()
Expand Down

0 comments on commit 7b7d10e

Please sign in to comment.