Skip to content

Commit

Permalink
FIX: Pass a C-contiguous array to points_in_polygon (#409)
Browse files Browse the repository at this point in the history
  • Loading branch information
jwiggins committed Jul 12, 2018
1 parent 525a48b commit 0bfc04a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions chaco/tools/lasso_selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
# Major library imports
import numpy
from numpy import array, empty, sometrue, transpose, vstack, zeros
from numpy import array, empty, sometrue, vstack, zeros, ascontiguousarray

# Enthought library imports
from traits.api import Any, Array, Enum, Event, Bool, Instance, \
Expand Down Expand Up @@ -308,8 +308,9 @@ def _map_data(self, point):
def _get_data(self):
""" Returns the datapoints in the plot, as an Nx2 array of (x,y).
"""
return transpose(array((self.plot.index.get_data(), self.plot.value.get_data())))

points = array((self.plot.index.get_data(),
self.plot.value.get_data()))
return ascontiguousarray(points.T)

#------------------------------------------------------------------------
# Property getter/setters
Expand Down

0 comments on commit 0bfc04a

Please sign in to comment.