title: 3d plotting with python
body: <p>I'm trying to plot a surface in python. I have a table of N by N values. I have created two vectors X and Y each of N elements. When I try to plot this, I get an error:</p>
  
  <pre><code>ValueError: total size of new array must be unchanged
  </code></pre>
  
  <p>I have checked the examples and I see there that for N elements of Z there are N elements for X and Y. </p>
  
  <p>This doesn't make any sense for me. How come I need N elements and not N by N?</p>
  
  <p>Here is a sample code:</p>
  
  <p>import random
  import math</p>
  
  <pre><code>from mpl_toolkits.mplot3d import Axes3D
  import matplotlib.pyplot as plt
  import numpy as np
  
  bignum = 100
  
  mat = []
  X = []
  Y = []
  
  for x in range(0,bignum):
      mat.append([])
      X.append(x);
      for y in range (0,bignum):
          mat[x].append(random.random())
          Y.append(y)
  
  fig = plt.figure(figsize=plt.figaspect(2.))
  ax = fig.add_subplot(1,1,1, projection='3d')
  surf = ax.plot_surface(X,Y,mat)
  </code></pre>