Thanks to visit codestin.com
Credit goes to github.com

Skip to content

FAQ and unit/ still refers to nxutils #3004

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 13, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.