How to make a matrix out of existing xyz data
问题 I want to use matplotlib.pyplot.pcolormesh to plot a depth plot. What I have is a xyz file Three columns i.e. x(lat), y(lon), z(dep). All columns are of equal length pcolormesh require matrices as input. So using numpy.meshgrid I can transform the x and y into matrices: xx,yy = numpy.meshgrid(x_data,y_data) This works great...However, I don't know how to create Matrix of my depth (z) data... How do I create a matrix for my z_data that corresponds to my x_data and y_data matrices? 回答1: