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

Add option color to function `plot_single_traj`

This is useful for hacking.
parent 56e2bcd4
No related branches found
No related tags found
No related merge requests found
...@@ -26,9 +26,9 @@ def get_extr_coord(traj, e_overestim, SHPC, orientation): ...@@ -26,9 +26,9 @@ def get_extr_coord(traj, e_overestim, SHPC, orientation):
return x, y return x, y
def plot_single_traj(traj, e_overestim, SHPC, orientation, ax, src_crs, def plot_single_traj(traj, e_overestim, SHPC, orientation, ax, src_crs,
annotate_flag): annotate_flag, color):
x, y = get_extr_coord(traj, e_overestim, SHPC, orientation) x, y = get_extr_coord(traj, e_overestim, SHPC, orientation)
ax.plot(x, y, color = "red", linewidth = 0.5, transform = src_crs) ax.plot(x, y, color, linewidth = 0.5, transform = src_crs)
ax.plot(x[0], y[0], marker = "s", markersize = 2, color = "black", ax.plot(x[0], y[0], marker = "s", markersize = 2, color = "black",
transform = src_crs) transform = src_crs)
...@@ -84,7 +84,7 @@ if __name__ == "__main__": ...@@ -84,7 +84,7 @@ if __name__ == "__main__":
if args.min_duration == 1: if args.min_duration == 1:
for traj in expanded_traj: for traj in expanded_traj:
plot_single_traj(traj, e_overestim, SHPC, args.orientation, ax, plot_single_traj(traj, e_overestim, SHPC, args.orientation, ax,
src_crs, args.annotate) src_crs, args.annotate, color = "red")
else: else:
# args.min_duration > 1 # args.min_duration > 1
n_long_traj = 0 n_long_traj = 0
...@@ -94,7 +94,7 @@ if __name__ == "__main__": ...@@ -94,7 +94,7 @@ if __name__ == "__main__":
if duration >= args.min_duration: if duration >= args.min_duration:
n_long_traj += 1 n_long_traj += 1
plot_single_traj(traj, e_overestim, SHPC, args.orientation, ax, plot_single_traj(traj, e_overestim, SHPC, args.orientation, ax,
src_crs, args.annotate) src_crs, args.annotate, color = "red")
print("Number of trajectories with sufficient duration:", n_long_traj) print("Number of trajectories with sufficient duration:", n_long_traj)
......
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