Skip to content

Commit

Permalink
Remove dregs of nxutils
Browse files Browse the repository at this point in the history
  • Loading branch information
mdboom committed Jul 12, 2014
1 parent 9e0dd74 commit 5940538
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 362 deletions.
47 changes: 0 additions & 47 deletions doc/faq/howto_faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -281,53 +281,6 @@ to achieve the desired plot::

plt.show()

.. _point-in-poly:

Test whether a point is inside a polygon
----------------------------------------

The :mod:`~matplotlib.nxutils` provides two high-performance methods:
for a single point use :func:`~matplotlib.nxutils.pnpoly` and for an
array of points use :func:`~matplotlib.nxutils.points_inside_poly`.
For a discussion of the implementation see `pnpoly
<http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html>`_.

.. sourcecode:: ipython

In [25]: import numpy as np

In [26]: import matplotlib.nxutils as nx

In [27]: verts = np.array([ [0,0], [0, 1], [1, 1], [1,0]], float)

In [28]: nx.pnpoly( 0.5, 0.5, verts)
Out[28]: 1

In [29]: nx.pnpoly( 0.5, 1.5, verts)
Out[29]: 0

In [30]: points = np.random.rand(10,2)*2

In [31]: points
Out[31]:
array([[ 1.03597426, 0.61029911],
[ 1.94061056, 0.65233947],
[ 1.08593748, 1.16010789],
[ 0.9255139 , 1.79098751],
[ 1.54564936, 1.15604046],
[ 1.71514397, 1.26147554],
[ 1.19133536, 0.56787764],
[ 0.40939549, 0.35190339],
[ 1.8944715 , 0.61785408],
[ 0.03128518, 0.48144145]])

In [32]: nx.points_inside_poly(points, verts)
Out[32]: array([False, False, False, False, False, False, False, True, False, True], dtype=bool)

.. htmlonly::

For a complete example, see :ref:`event_handling-lasso_demo`.

.. _howto-set-zorder:

Control the depth of plot elements
Expand Down
254 changes: 0 additions & 254 deletions src/nxutils.c

This file was deleted.

30 changes: 0 additions & 30 deletions unit/inside_poly_memleak.py

This file was deleted.

31 changes: 0 additions & 31 deletions unit/inside_poly_profile.py

This file was deleted.

0 comments on commit 5940538

Please sign in to comment.