Skip to content
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

Using qhull for Delaunay triangulation #2504

Merged
merged 5 commits into from Dec 20, 2013
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
44 changes: 24 additions & 20 deletions CHANGELOG
@@ -1,6 +1,11 @@
2013-11-28 Added qhull extension module to perform Delaunay triangulation more
robustly than before. It is used by tri.Triangulation (and hence
all pyplot.tri* methods) and mlab.griddata. Deprecated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did a whole bunch of entries in the ChangeLog get re-indented?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They were using tabs not spaces.

matplotlib.delaunay module. - IMT

2013-10-27 Added get_rlabel_position and set_rlabel_position methods to
PolarAxes to control angular position of radial tick labels.
PolarAxes to control angular position of radial tick labels.

2013-10-06 Add stride-based functions to mlab for easy creation of 2D arrays
with less memory.

Expand All @@ -27,16 +32,16 @@
and matplotlib.units.Registry.

2013-06-26 Refactored the axes module: the axes module is now a folder,
containing the following submodule:
- _subplots.py, containing all the subplots helper methods
- _base.py, containing several private methods and a new
_AxesBase class. This _AxesBase class contains all the methods
that are not directly linked to plots of the "old" Axes
- _axes.py contains the Axes class. This class now inherits from
_AxesBase: it contains all "plotting" methods and labelling
methods.
This refactoring should not affect the API. Only private methods
are not importable from the axes module anymore.
containing the following submodule:
- _subplots.py, containing all the subplots helper methods
- _base.py, containing several private methods and a new
_AxesBase class. This _AxesBase class contains all the methods
that are not directly linked to plots of the "old" Axes
- _axes.py contains the Axes class. This class now inherits from
_AxesBase: it contains all "plotting" methods and labelling
methods.
This refactoring should not affect the API. Only private methods
are not importable from the axes module anymore.

2013-05-18 Added support for arbitrary rasterization resolutions to the
SVG backend. Previously the resolution was hard coded to 72
Expand All @@ -52,22 +57,21 @@

2013-04-25 Changed all instances of:

from matplotlib import MatplotlibDeprecationWarning as mplDeprecation
to:

from cbook import mplDeprecation
from matplotlib import MatplotlibDeprecationWarning as mplDeprecation
to:

and removed the import into the matplotlib namespace in __init__.py
Thomas Caswell
from cbook import mplDeprecation

and removed the import into the matplotlib namespace in __init__.py
Thomas Caswell

2013-04-15 Added 'axes.xmargin' and 'axes.ymargin' to rpParams to set default
margins on auto-scaleing. - TAC
margins on auto-scaleing. - TAC

2013-04-16 Added patheffect support for Line2D objects. -JJL

2013-03-19 Added support for passing `linestyle` kwarg to `step` so all `plot`
kwargs are passed to the underlying `plot` call. -TAC
kwargs are passed to the underlying `plot` call. -TAC

2013-02-25 Added classes CubicTriInterpolator, UniformTriRefiner, TriAnalyzer
to matplotlib.tri module. - GBy
Expand Down
4 changes: 1 addition & 3 deletions MANIFEST.in
Expand Up @@ -14,7 +14,5 @@ recursive-include LICENSE *
recursive-include examples *
recursive-include doc *
recursive-include src *.cpp *.c *.h *.m
recursive-include CXX *.cxx *.hxx *.c *.h
recursive-include agg24 *
recursive-include lib *
recursive-include ttconv *.cpp *.h
recursive-include extern *
38 changes: 12 additions & 26 deletions examples/pylab_examples/griddata_demo.py
Expand Up @@ -6,36 +6,22 @@
#npts = int(raw_input('enter # of random points to plot:'))
seed(0)
npts = 200
x = uniform(-2,2,npts)
y = uniform(-2,2,npts)
z = x*np.exp(-x**2-y**2)
x = uniform(-2, 2, npts)
y = uniform(-2, 2, npts)
z = x*np.exp(-x**2 - y**2)
# define grid.
xi = np.linspace(-2.1,2.1,100)
yi = np.linspace(-2.1,2.1,200)
xi = np.linspace(-2.1, 2.1, 100)
yi = np.linspace(-2.1, 2.1, 200)
# grid the data.
zi = griddata(x,y,z,xi,yi,interp='linear')
zi = griddata(x, y, z, xi, yi, interp='linear')
# contour the gridded data, plotting dots at the nonuniform data points.
CS = plt.contour(xi,yi,zi,15,linewidths=0.5,colors='k')
CS = plt.contourf(xi,yi,zi,15,cmap=plt.cm.rainbow,
CS = plt.contour(xi, yi, zi, 15, linewidths=0.5, colors='k')
CS = plt.contourf(xi, yi, zi, 15, cmap=plt.cm.rainbow,
vmax=abs(zi).max(), vmin=-abs(zi).max())
plt.colorbar() # draw colorbar
plt.colorbar() # draw colorbar
# plot data points.
plt.scatter(x,y,marker='o',c='b',s=5,zorder=10)
plt.xlim(-2,2)
plt.ylim(-2,2)
plt.scatter(x, y, marker='o', c='b', s=5, zorder=10)
plt.xlim(-2, 2)
plt.ylim(-2, 2)
plt.title('griddata test (%d points)' % npts)
plt.show()

# test case that scikits.delaunay fails on, but natgrid passes..
#data = np.array([[-1, -1], [-1, 0], [-1, 1],
# [ 0, -1], [ 0, 0], [ 0, 1],
# [ 1, -1 - np.finfo(np.float_).eps], [ 1, 0], [ 1, 1],
# ])
#x = data[:,0]
#y = data[:,1]
#z = x*np.exp(-x**2-y**2)
## define grid.
#xi = np.linspace(-1.1,1.1,100)
#yi = np.linspace(-1.1,1.1,100)
## grid the data.
#zi = griddata(x,y,z,xi,yi)
38 changes: 38 additions & 0 deletions extern/qhull/COPYING.txt
@@ -0,0 +1,38 @@
Qhull, Copyright (c) 1993-2012

C.B. Barber
Arlington, MA

and

The National Science and Technology Research Center for
Computation and Visualization of Geometric Structures
(The Geometry Center)
University of Minnesota

email: qhull@qhull.org

This software includes Qhull from C.B. Barber and The Geometry Center.
Qhull is copyrighted as noted above. Qhull is free software and may
be obtained via http from www.qhull.org. It may be freely copied, modified,
and redistributed under the following conditions:

1. All copyright notices must remain intact in all files.

2. A copy of this text file must be distributed along with any copies
of Qhull that you redistribute; this includes copies that you have
modified, or copies of programs or other software products that
include Qhull.

3. If you modify Qhull, you must include a notice giving the
name of the person performing the modification, the date of
modification, and the reason for such modification.

4. When distributing modified versions of Qhull, or other software
products that include Qhull, you must provide notice that the original
source code may be obtained as noted above.

5. There is no warranty or other guarantee of fitness for Qhull, it is
provided solely "as is". Bug reports or fixes may be sent to
qhull_bug@qhull.org; the authors may or may not act on them as
they desire.