How should arrays for plot_surface be built?

Viewed 4264

I'm trying to understand how to build arrays for use in plot_surface (in Axes3d). I tried to build a simple surface manipulating data of those arrays:

In [106]: x
Out[106]: 
array([[0, 0],
       [0, 1],
       [0, 0]])

In [107]: y
Out[107]: 
array([[0, 0],
       [1, 1],
       [0, 0]])

In [108]: z
Out[108]: 
array([[0, 0],
       [1, 1],
       [2, 2]])

But I can't figure out how they are interpreted - for example there is nothing in z=2 on my plot. Anybody please explain exactly which values will be taken to make point, which for line and finally surface.

For example I would like to build a surface that would connect with lines points: [0,0,0]->[1,1,1]->[0,0,2] [0,0,0]->[1,-1,1]->[0,0,2] and a surface between those lines. What should arrays for plot_surface look like to get something like this?

2 Answers
Related