


# create 2d x,y grid (both X and Y will be 2d) Anaconda.) However, syntax should be not be very different in older versions.įirst, make the necessary imports: import numpy as npįor the case when you have 3 columns of 1d data - x, y and z: DataAll1D = np.loadtxt("datacsv_1d.csv", delimiter=",") (Numpy is a numerical Python package that is commonly included in Python distributions, e.g. This answer assumes you are using Python 3 and a recent version of Matplotlib and Numpy. Once you have those then at least you are in a good position to start customizing your plot using documentation and other examples found on the web.

This makes sense because every (x, y) point needs a Z value and there are N x N (x, y) points. Note that in the general case you need an NxN matrix of Z values for a plot where X and Y are vectors of length N. I think you're asking several questions here, I will try and answer the most fundamental one: loading your CSV data into Python and then plotting a basic surface plot.
