Fixed selections. points_inside_poly is deprecated, and all calls are therefore
rewritten to use Path.contains_points.
This commit is contained in:
parent
2b4da82165
commit
36146893e6
|
@ -4,7 +4,6 @@ import gtk
|
|||
|
||||
import matplotlib
|
||||
from matplotlib.backends.backend_gtkagg import FigureCanvasGTKAgg
|
||||
from matplotlib.nxutils import points_inside_poly
|
||||
from matplotlib.figure import Figure
|
||||
from matplotlib.collections import LineCollection
|
||||
from matplotlib.patches import Polygon,Rectangle,Circle
|
||||
|
@ -334,7 +333,7 @@ class ScatterMarkerPlot(Plot):
|
|||
|
||||
def lasso_select_callback(self, verts, key=None):
|
||||
xys = scipy.c_[self.xaxis_data[:,scipy.newaxis], self.yaxis_data[:,scipy.newaxis]]
|
||||
index = scipy.nonzero(points_inside_poly(xys, verts))[0]
|
||||
index = scipy.nonzero(verts.contains_points(xys))
|
||||
ids = self.dataset_1.get_identifiers(self.current_dim, index)
|
||||
ids = self.update_selection(ids, key)
|
||||
self.selection_listener(self.current_dim, ids)
|
||||
|
@ -608,7 +607,8 @@ class ScatterPlot(Plot):
|
|||
|
||||
def lasso_select_callback(self, verts, key=None):
|
||||
xys = scipy.c_[self.xaxis_data[:,scipy.newaxis], self.yaxis_data[:,scipy.newaxis]]
|
||||
index = scipy.nonzero(points_inside_poly(xys, verts))[0]
|
||||
poly = matplotlib.path.Path(verts, closed=True)
|
||||
index = scipy.nonzero(poly.contains_points(xys))[0]
|
||||
ids = self.dataset_1.get_identifiers(self.current_dim, index)
|
||||
ids = self.update_selection(ids, key)
|
||||
self.selection_listener(self.current_dim, ids)
|
||||
|
@ -719,7 +719,7 @@ class HistogramPlot(Plot):
|
|||
if self.current_dim == None: return
|
||||
self.active_patches = []
|
||||
for patch in self.patches:
|
||||
if scipy.any(points_inside_poly(verts, patch.get_verts())):
|
||||
if scipy.any(verts.contains_points(patch.get_verts())):
|
||||
self.active_patches.append(patch)
|
||||
if not self.active_patches: return
|
||||
ids = set()
|
||||
|
@ -902,7 +902,7 @@ class NetworkPlot(Plot):
|
|||
|
||||
def lasso_select_callback(self, verts, key=None):
|
||||
xys = scipy.c_[self.xaxis_data[:,scipy.newaxis], self.yaxis_data[:,scipy.newaxis]]
|
||||
index = scipy.nonzero(points_inside_poly(xys, verts))[0]
|
||||
index = scipy.nonzero(verts.contains_ponts(xys))
|
||||
ids = self.dataset.get_identifiers(self.current_dim, index)
|
||||
ids = self.update_selection(ids, key)
|
||||
self.selection_listener(self.current_dim, ids)
|
||||
|
|
Reference in New Issue