It sounds like you don't need to pass xi and yi through the meshgrid . Check docstrings for functions in which you use xi and yi . Many accept (and even expect) 1-D arrays.
For instance:
In [33]: x Out[33]: array([0, 0, 0, 1, 1, 1, 2, 2, 2]) In [34]: y Out[34]: array([0, 1, 2, 0, 1, 2, 0, 1, 2]) In [35]: z Out[35]: array([0, 1, 4, 1, 2, 5, 2, 3, 6]) In [36]: xi Out[36]: array([ 0. , 0.5, 1. , 1.5, 2. ]) In [37]: yi Out[37]: array([ 0. , 0.33333333, 0.66666667, 1. , 1.33333333, 1.66666667, 2. ]) In [38]: zi = griddata(x, y, z, xi, yi) In [39]: zi Out[39]: array([[ 0. , 0.5 , 1. , 1.5 , 2. ], [ 0.33333333, 0.83333333, 1.33333333, 1.83333333, 2.33333333], [ 0.66666667, 1.16666667, 1.66666667, 2.16666667, 2.66666667], [ 1. , 1.61111111, 2. , 2.61111111, 3. ], [ 2. , 2.5 , 3. , 3.5 , 4. ], [ 3. , 3.5 , 4. , 4.5 , 5. ], [ 4. , 4.5 , 5. , 5.5 , 6. ]]) In [40]: plt.contour(xi, yi, zi) Out[40]: <matplotlib.contour.QuadContourSet instance at 0x3ba03b0>