diff --git a/Trajectories/plot_traj.py b/Trajectories/plot_traj.py
index 6dfab41819381b59a2e73afc12dfb4ce225ae4c3..4e646e07d37e48a27dbe632817d261542dee63ec 100755
--- a/Trajectories/plot_traj.py
+++ b/Trajectories/plot_traj.py
@@ -4,7 +4,7 @@ import report_graph
 import numpy as np
 import random
 
-def plot_single_traj(traj, e_overestim, SHPC, ax, src_crs, annotate_flag):
+def get_extr_coord(traj, e_overestim, SHPC):
     xy = []
 
     for node in traj:
@@ -15,7 +15,10 @@ def plot_single_traj(traj, e_overestim, SHPC, ax, src_crs, annotate_flag):
         shape = SHPC.get_reader(i_slice, layer = "extremum").shape(ishape)
         xy.append(shape.points[0])
 
-    xy = np.array(xy)
+    return np.array(xy)
+
+def plot_single_traj(traj, e_overestim, SHPC, ax, src_crs, annotate_flag):
+    xy = get_extr_coord(traj, e_overestim, SHPC)
     ax.plot(xy[:, 0], xy[:, 1], color = "red", transform = src_crs)
     ax.plot(xy[0, 0], xy[0, 1], marker = "s", color = "black",
             transform = src_crs)