diff --git a/Analysis/plot_traj.py b/Analysis/plot_traj.py index 63d0c1b486ec68e0e47f6d8efcc40590758b35cb..e1cdfd5e76d18bfbdf5f1bde74d5d9beed1d4724 100755 --- a/Analysis/plot_traj.py +++ b/Analysis/plot_traj.py @@ -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()