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

Move `set_title` outside of `snapshot`

In some use cases, we would rather not overwrite the title. For
example, if we overlap eddies at several dates, we may want to keep
the first date. Argument k was only used for the title. It is also
clearer not to have k as an argument because it did not select the
eddies plotted, the selection is made by argument `ishape_list`.
parent 80a9d87c
No related branches found
No related tags found
No related merge requests found
......@@ -54,14 +54,12 @@ def select_ishapes(k, k1, ishape_last, reader_extr, window = None):
return ishape_list
def snapshot(k, ax, ishape_list, reader_extr, reader_outer, reader_m_s = None,
*, dashed = False, light = False, src_crs = ccrs.PlateCarree()):
def snapshot(ax, ishape_list, reader_extr, reader_outer, reader_m_s = None, *,
dashed = False, light = False, src_crs = ccrs.PlateCarree()):
"""Plots extrema, outermost contours and max-speed contours.
dashed: boolean."""
ax.set_title(f"k = {k}", y = 1.05)
for ishape in ishape_list:
shape_rec_extr = reader_extr.shapeRecord(ishape)
shape_outer = reader_outer.shape(ishape)
......@@ -277,7 +275,8 @@ if __name__ == "__main__":
if args.window is None: plot_grid_bb(args.shp_tr_dir, ax)
ishape_list = select_ishapes(k, k1, ishape_last, reader_extr,
args.window)
snapshot(k, ax, ishape_list, reader_extr, reader_outer, reader_m_s,
ax.set_title(f"k = {k}", y = 1.05)
snapshot(ax, ishape_list, reader_extr, reader_outer, reader_m_s,
dashed = args.dashed, light = args.light)
ax.gridlines(draw_labels = True)
ax.coastlines()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment