Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Rightclick on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
From: Ethan Swint <eswint@vt...>  20120110 21:34:55

Hi I was working off of the example listed at http://matplotlib.sourceforge.net/examples/pylab_examples/griddata_demo.html, adapting it to my own data, and encountered the following error on MLAB 1.1.0, Python 2.7.2: <code> from numpy.random import uniform, seed from matplotlib.mlab import griddata import matplotlib.pyplot as plt import numpy as np # make up data. #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**2y**2) xi = np.linspace(0,60,100) # <= my xdata range yi = np.linspace(0,0.9,200) # <= my ydata range zi = griddata(x,y,z,xi,yi,interp='linear') </code> which produces  ValueError Traceback (most recent call last) C:\Users\Ethan\code\PythonScripts\<ipythoninput751e10e494403> in <module>() > 1 zi = griddata(x,y,z,xi,yi,interp='linear') It seems that 'xi,yi = np.meshgrid(xi,yi)' from line 2766 of mlab.py doesn't always produce uniformly spaced data, as the test for uniform data fails at line 2779. Ignoring the error, however, results in satisfactory evaluation of interp() on 2783. Can anyone else reproduce? Regards, Ethan 