John Hunter wrote:
> On Tue, Oct 14, 2008 at 2:58 PM, Eric Firing <[EMAIL PROTECTED]> wrote:
>> mask = (PyArrayObject *)PyArray_SimpleNew(1,dimensions,PyArray_INT);
>>
>> in nxutils.cpp would become
>>
>> mask = (PyArrayObject *)PyArray_SimpleNew(1,dimensions, NPY_BOOL);
>>
>> Can anyone think of
On Tue, Oct 14, 2008 at 2:58 PM, Eric Firing <[EMAIL PROTECTED]> wrote:
> mask = (PyArrayObject *)PyArray_SimpleNew(1,dimensions,PyArray_INT);
>
> in nxutils.cpp would become
>
> mask = (PyArrayObject *)PyArray_SimpleNew(1,dimensions, NPY_BOOL);
>
> Can anyone think of anything this would break,
Pierre GM wrote:
> Mathew,
> Have you tried the solution that was suggested by Angus yesterday on the
> numpy
> mailing list ?
>
> http://projects.scipy.org/pipermail/scipy-user/2008-February/015418.html
>
import numpy as np
import matplotlib.nxutils as nxutils
polygon=np.array([
Angus originally suggest matplotlib. The other proposed solutions are
overkill, unless it turns out that performance is a problem
Thanks
Mathew
Pierre GM wrote:
> Mathew,
> Have you tried the solution that was suggested by Angus yesterday on the
> numpy
> mailing list ?
>
> http://projects.sci
Thanks! Thats exactly what I was looking for!
Mathew
Michael Droettboom wrote:
> If you can convert your polygon to a path, you can use the
> "contains_point" method:
>
> >>> from matplotlib import path
> >>> p = path.Path([[0,0], [42, 3], [45, 23], [1, 32]])
> >>> p.contains_point([5,5])
> 1
>
Mathew,
Have you tried the solution that was suggested by Angus yesterday on the numpy
mailing list ?
http://projects.scipy.org/pipermail/scipy-user/2008-February/015418.html
>>> import numpy as np
>>> import matplotlib.nxutils as nxutils
>>> polygon=np.array([(0,0),(0,1),(1,1),(1,0)])
>>> point
If you can convert your polygon to a path, you can use the
"contains_point" method:
>>> from matplotlib import path
>>> p = path.Path([[0,0], [42, 3], [45, 23], [1, 32]])
>>> p.contains_point([5,5])
1
>>> p.contains_point([72, 3])
0
Mike
Mathew Yeates wrote:
> Is there a routine in matplotl
Is there a routine in matplotlib for telling whether a point is inside a
convex 4 sided polygon?
Mathew
-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applicat