Commit 502d4208 authored by Jay's avatar Jay Committed by jay
Browse files

Fixes loc vs iloc in a view

parent 77ef49c4
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -176,17 +176,17 @@ def plot_edge(edge, ax=None, clean_keys=[], image_space=100,

    matches, mask = edge._clean(clean_keys)

    source_keypoints = edge.source.get_keypoints(index=mask)
    destination_keypoints = edge.destination.get_keypoints(index=mask)
    source_keypoints = edge.source.get_keypoints(index=mask.index)
    destination_keypoints = edge.destination.get_keypoints(index=mask.index)

    # Plot the source
    source_idx = matches['source_idx'].values
    s_kps = source_keypoints.iloc[source_idx]
    s_kps = source_keypoints.loc[source_idx]
    ax.scatter(s_kps['x'], s_kps['y'], **scatter_kwargs)

    # Plot the destination
    destination_idx = matches['destination_idx'].values
    d_kps = destination_keypoints.iloc[destination_idx]
    d_kps = destination_keypoints.loc[destination_idx]
    x_offset = s_shape[0] + image_space
    newx = d_kps['x'] + x_offset
    ax.scatter(newx, d_kps['y'], **scatter_kwargs)