diff --git a/system/plots.py b/system/plots.py index 1b2f253..84b1989 100644 --- a/system/plots.py +++ b/system/plots.py @@ -187,7 +187,7 @@ class Plot (gtk.Frame): def set_project(self, project): self.project = project - + class EmptyView (Plot): def __init__(self): @@ -260,6 +260,8 @@ class ScatterPlot(Plot): x2, y2 = event2.xdata, event2.ydata ydata = self.yaxis_data xdata = self.xaxis_data + + # find indices of selected area if x1>x2: if y1x2) & (ydata>y1) & (ydatax1) & (xdatay2)) - ids = [id for id,ind in self.dataset[self.current_dim].items() if ind in index] + # generate ids for selected indices + reverse = {} + for key, value in self.dataset[self.current_dim].items(): + reverse[value] = key + ids = [] + for ind in index: + ids.append(reverse[ind]) + self.project.set_selection(self.current_dim,ids) def update(self, key):