I have two numpy arrays representing x and ycoordinates in two dimensions. These (x, y) positions give coordinates of points in a 2D plane. Examples of the arrays x and y are given below.
x = np.array([1.0, 4.0, 3.0, 5.0])
y = np.array([1.5, 4.2, 3.5, 5.2])
In the above example, we have coordinates of four two dimensional (x,y) points [i.e.(1.0, 1.5), (4.0, 4.2), (3.0, 3.5), (5.0, 5.2)].
Starting from each of these four two dimensional (x, y) points, I have arrays which represent z coordinates. For this example, I will have four z arrays. Let's consider examples given below.
z1 = np.array([3.1, 3.6, 7.8, 9.2, 11.2, 11.7])
z2 = np.array([4.2, 4.8, 5.9, 10.2])
z3 = np.array([2.1, 2.5, 2.8, 3.5, 4.9])
z4 = np.array([2.0, 4.5, 5.7, 7.2, 7.8, 8.1, 9.2, 15.6])
The different z arrays (z1, z2, z3 and z4) are expected to be of unequal lengths.
I want to have a three dimensional plot of these z arrays (starting from the mentioned (x, y) positions ) using matplotlib. An example of the kind of plot that I am expecting can be found below.
I tried to start with this:
Axes3D.scatter(xs=x, ys=y, zs=z1, zdir='z)
But, I get the following error:
TypeError: unbound method scatter() must be called with Axes3D instance as first argument (got nothing instead)
How can make the desired three dimensional plot for the simple example (x, y and z arrays) that I have given in this question (I am using python 2.7)?

