Hi,
I'm trying to contour some data that I have and the griddata line fails. I tried running it on some synthetically generated data and I get the same IndexError. Any Ideas?
Here is the example with the synthetic data:
x = y = arange(-10,10,0.01)
z = x**2+y**3
xi = yi = linspace(-10.1, 10.1, 100)
zi = griddata(x, y, z, xi, yi)
···
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
<ipython-input-52-0458ab6ea672> in <module>()
----> 1 zi = griddata(x, y, z, xi, yi)
/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/matplotlib/mlab.py in griddata(x, y, z, xi, yi, interp)
2766 xi,yi = np.meshgrid(xi,yi)
2767 # triangulate data
-> 2768 tri = delaunay.Triangulation(x,y)
2769 # interpolate data
2770 if interp == 'nn':
/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/matplotlib/delaunay/triangulate.py in __init__(self, x, y)
88 self.triangle_neighbors = delaunay(self.x, self.y)
89
---> 90 self.hull = self._compute_convex_hull()
91
92 def _collapse_duplicate_points(self):
/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/matplotlib/delaunay/triangulate.py in _compute_convex_hull(self)
113
114 edges = {}
--> 115 edges.update(dict(zip(self.triangle_nodes[border[:,0]][:,1],
116 self.triangle_nodes[border[:,0]][:,2])))
117 edges.update(dict(zip(self.triangle_nodes[border[:,1]][:,2],
IndexError: invalid index