From 1d30dbdd6e9ad0a1745ad2d7f17ceea4d0fc164b Mon Sep 17 00:00:00 2001 From: eberrigan <106755962+eberrigan@users.noreply.github.com> Date: Tue, 25 Jul 2023 18:58:40 -0700 Subject: [PATCH] Fix plotting for using sleap-io API (#47) --- sleap_roots/series.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sleap_roots/series.py b/sleap_roots/series.py index b40db14..a434fad 100644 --- a/sleap_roots/series.py +++ b/sleap_roots/series.py @@ -277,9 +277,9 @@ def plot_instance( h_lines.append(h_lines_k) else: - for k, (src_node, dst_node) in enumerate(skeleton.edges): - src_pt = instance.points_array[instance.skeleton.node_to_index(src_node)] - dst_pt = instance.points_array[instance.skeleton.node_to_index(dst_node)] + for k, (src_ind, dst_ind) in enumerate(skeleton.edge_inds): + src_pt = inst_pts[src_ind] + dst_pt = inst_pts[dst_ind] x = np.array([src_pt[0], dst_pt[0]]) y = np.array([src_pt[1], dst_pt[1]])