Please look at Axes3D.plot_surface or other Axes3D methods. Here you can find examples and inspiration, here or here .
Edit:
Z-data that is not on a regular XY grid (equal distances between grid points in one dimension) is not trivial to construct as a triangulated surface. For a given set of irregular (X, Y) coordinates, there are several possible triangulations. One triangulation can be calculated using the Delaunay "nearest neighbor" algorithm. This can be done in matplotlib. However, this is still a bit tedious:
http://matplotlib.1069221.n5.nabble.com/Plotting-3D-Irregularly-Triangulated-Surfaces-An-Example-td9652.html
It looks like support will be improved:
http://matplotlib.org/examples/pylab_examples/tripcolor_demo.html http://matplotlib.1069221.n5.nabble.com/Custom-plot-trisurf-triangulations-tt39003.html
Using http://docs.enthought.com/mayavi/mayavi/auto/example_surface_from_irregular_data.html I was able to find a very simple Mayavi based solution:
import numpy as np from mayavi import mlab X = np.array([0, 1, 0, 1, 0.75]) Y = np.array([0, 0, 1, 1, 0.75]) Z = np.array([1, 1, 1, 1, 2])
This is a very simple example based on 5 points. 4 of them are at level z 1:
(0, 0) (0, 1) (1, 0) (1, 1)
One of them is at z-level 2:
(0.75, 0.75)
The Delaunay algorithm gets the correct triangulation, and the surface is drawn as expected:

I ran the above code on Windows after installing Python (x, y) using the command
ipython -wthread script.py