I have a .txt file with values
x1 y1 z1
x2 y2 z2
etc.
With my previous little experience I was trying to draw a contourf, with this code
import numpy as np import matplotlib from matplotlib import rc import matplotlib.mlab as ml from pylab import * rc('font', family='serif') rc('font', serif='Times New Roman') rc('font', size='9') rc('text', usetex=True) from matplotlib.mlab import griddata import matplotlib.pyplot as plt import numpy.ma as ma from numpy.random import uniform from matplotlib.colors import LogNorm matplotlib.use('pgf') fig = plt.figure() data = np.genfromtxt('Velocidad.txt') matplotlib.rcParams['xtick.direction'] = 'out' matplotlib.rcParams['ytick.direction'] = 'out' rc('text', usetex=True) rc('font', family='serif') x = data[:,0] y = data[:,1] z = data[:,2] xi = np.linspace(0,3000.0, 400) yi = np.linspace(0,4.0, 200) zi = griddata(x,y,z,xi,yi,interp='nn') CS = plt.contourf(xi,yi,zi,200,cmap=plt.cm.jet,rasterized=True) plt.colorbar() plt.xlim(0,3000) plt.ylim(0,4.0) plt.ylabel(r'$t$') plt.xlabel(r'$x$') plt.title(r' Contour de $v(x,t)$') plt.savefig("CampoVel.png", dpi=100) plt.show() the problem is the output:

When I see this picture and I look at the data (which is here, in this link) and I don't understand those discontinuities in x=750 and x=1875. And those strange vertical lines all over the plot. Looking at the data I would expect something smooth, at least in those positions, but the output obviously isn't. Is this a problem of griddata()? How can I solve it?
I have been told that as my data is regularly spaced on X and Y, I shouldn't use griddata(), but I have looked examples and I can't get the code to work.
