Skip to content
Snippets Groups Projects
Commit 92bc155d authored by Lionel GUEZ's avatar Lionel GUEZ
Browse files

Add option save

For the test of the script in `tests.json`. Normally, we would save to
pdf, but pdf format includes a date stamp. So pdf is not convenient
for testing. So we include the format value in argument save and we
save to png for the automated test.
parent 742d1628
No related branches found
No related tags found
No related merge requests found
......@@ -95,6 +95,8 @@ if __name__ == "__main__":
"shapefiles, with visible eddies at all dates")
parser.add_argument("-l", "--label",
choices = ["root", "leaf", "split", "merge"])
parser.add_argument("-s", "--save", default = "pdf", metavar = "format",
help = "Save file to specified format")
group = parser.add_mutually_exclusive_group()
group.add_argument("-n", "--node", help = "Select component containing "
"node, with orientation cyclo or anti", nargs = 3,
......@@ -171,4 +173,9 @@ if __name__ == "__main__":
ax.coastlines()
ax.gridlines(draw_labels = True)
print("Elapsed time:", time.perf_counter() - t1, "s")
plt.show()
if args.save:
plt.savefig(f"plot_traj.{args.save}")
print(f'Created "plot_traj.{args.save}".')
else:
plt.show()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment