matlab porting question


What's the equivalent command in matplotlib to matlab's "surf"? I
assume it's Axes3D.plot_surface. But this doesn't see to work. The
code to be ported is:

s = surf(linspace(0,2,100), linspace(-1,1,100), fe');

But in matplotlib I've come up with:

terrain = R.randn(100, 100) / 1

nbumps = 20

f = lambda x: [int(v) for v in x]

bumpsx = 100 * R.rand(1, nbumps)
bumpsx = map(f, bumpsx.round())
bumpsy = 100 * R.rand(1, nbumps)
bumpsy = map(f, bumpsy.round())

f = lambda x: [abs(v) for v in x]

terrain[bumpsx, bumpsy] = map(f, abs(R.randn(1, nbumps))) # TODO:
abs(randn(nbumps, nbumps))

f = lambda x, y: I.lfilter((N.ones((1, x,)) / x)[0], 1, y)

fterrain = (f(20, f(15, terrain).conj().T)).conj().T

x = N.linspace(0, 2, 100)
y = N.linspace(-1, 1, 100)
z = fterrain

surface = axes3d.plot_surface(x, y, z)

The problem is that x, y, and z all should have the same shape (or at
least I assume from the example). But in what's above, x
and y have a shape of (100,), and z has a shape of (100,100). What
should I do instead?

I'm more than happy to share all the source code if that would be
instructive. Thanks.