Skip to content

Commit 71eaa37

Browse files
committed
Add option to save png file
Add option to save png file.
1 parent 7d57aee commit 71eaa37

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

landice/output_processing_li/plot_mass_balance.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
print("** Gathering information. (Invoke with --help for more details. All arguments are optional)")
1818
parser = OptionParser(description=__doc__)
1919
parser.add_option("-f", dest="fileName", help="input filename", default="globalStats.nc", metavar="FILENAME")
20+
parser.add_option("-s", dest="saveFile", help="save filename", default=None, metavar="FILENAME")
2021
options, args = parser.parse_args()
2122

2223
print("Using ice density of {} kg/m3 if required for unit conversions".format(rhoi))
@@ -192,5 +193,9 @@
192193
ax[0,2].set_title('Floating budget')
193194

194195
fig.subplots_adjust(wspace=0.5)
196+
197+
if options.saveFile is not None:
198+
fig.savefig(options.saveFile + '.png', dpi=400, bbox_inches="tight")
199+
195200
plt.show()
196201
f.close()

0 commit comments

Comments
 (0)