On 2010-02-16 00:40 AM, T J wrote: > Hi, > > I'm trying to grid irregularly spaced data, such that the convex hull > of the data is not rectangular. Specifically, all my data lies in an > equilateral triangle inside the unit circle. I found: > > > http://www.scipy.org/Cookbook/Matplotlib/Gridding_irregularly_spaced_data > > and tried the suggested technique. For my grid, I made a square of > the min and max of my data. However, it had problems: > > ... > File > "/home/guest/.local/lib/python2.6/site-packages/matplotlib/delaunay/triangulate.py", > line 125, in _compute_convex_hull > hull.append(edges.pop(hull[-1])) > KeyError: 0 > > > Should I expect matplotlib.mlab.griddata to work with a dataset like > this? I know that I can use hexbin, but it'd be really nice to see > contours explicitly.
It's not a problem with your points lying inside a triangle. There is some other problem with the construction of the Delaunay triangulation. Sometimes the algorithm fails. This is one way that it fails. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco ------------------------------------------------------------------------------ SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users