On Tue, Sep 27, 2011 at 11:55 AM, rajtendulkar
<pranav.tendul...@gmail.com>wrote:

> Dear Forum, I am a completely new user to matplotlib. I want to plot a 3D
> wireframe / surface plot with matplotlib. I am trying to understand how to
> arrange the data so that I will get the correct plot. After trying a lot and
> taking reference from different examples, I wrote a code given in the file
> temp.py <http://old.nabble.com/file/p32534574/temp.py>. Can anyone please
> tell me, how can I fix it to get a correct wireframe or surface plot? I
> don't understand the array Z how it should look like. Thank You, Raj
> temp.py <http://old.nabble.com/file/p32534574/temp.py>
>


I don't think your data is well-formed.  The input X, Y, and Z needs to be
2D with the same shape.  I am confused by your x and y data, which you then
pass into meshgrid.  To illustrate, meshgrid does this:

for:
x = [1, 2, 3, 4, 5]
y = [1, 2, 3]

then the command:
X, Y = numpy.meshgrid(x, y)

produces (for X):
array([[1, 2, 3, 4, 5],
       [1, 2, 3, 4, 5],
       [1, 2, 3, 4, 5]])

and (for Y):
array([[1, 1, 1, 1, 1],
       [2, 2, 2, 2, 2],
       [3, 3, 3, 3, 3]])

Your x and y look like they are flattened versions of these.  In addition,
your z doesn't seem to have enough values to fit the domain.

Ben Root
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to