title: Python contour plotting wrong values with plot_surface
body: <p>I want to plot a surface in Matplotlib consisting of zeros everywhere, except for a rectangular region centered in (0, 0), with sides (Dx, Dy), consisting of ones - kind of like a table, if you wil; I can do that using the <code>plot_surface</code> command, no worries there. I also want to plot its projections in the "x" and "y" directions (as in <a href="http://matplotlib.org/examples/mplot3d/contour3d_demo3.html" rel="nofollow">this demo</a>) and that's when the results become weird: Python seems to be interpolating my amplitude values (which, again, should be either zero or one) for the contour plots and showing some lines with values that do not correspond to my data points.</p>
  
  <p>This is what I'm doing:</p>
  
  <pre><code>import numpy
  from matplotlib import pylab
  from mpl_toolkits.mplot3d import axes3d
  
  Dx = 1.    # Define the sides of the rectangle
  Dy = 2.
  
  x_2D = numpy.linspace(-Dx, Dx, 100)     # Create the mesh points
  y_2D = numpy.linspace(-Dy, Dy, 100)
  x_mesh, y_mesh = numpy.meshgrid(x_2D, y_2D)
  
  rect_2D = numpy.zeros(x_mesh.shape)    # All values of "rect_2D" are zero...
  for i in range(x_2D.size):
      for j in range(y_2D.size):
          if numpy.abs(x_mesh[i, j]) &lt;= Dx/2 and numpy.abs(y_mesh[i, j]) &lt;= Dy/2:
              rect_2D[i, j] = 1.         # ... except these ones
  
  fig = pylab.figure(figsize=(9, 7))
  ax = fig.add_subplot(111, projection='3d')
  ax.plot_surface(x_mesh, y_mesh, rect_2D, alpha=0.3)
  
  ax.contour(x_mesh, y_mesh, rect_2D, zdir='x', offset=-1.5, cmap=pylab.cm.brg)
  ax.contour(x_mesh, y_mesh, rect_2D, zdir='y', offset=3, cmap=pylab.cm.brg)
  
  ax.set_xlim(-1.5, 1.5)
  ax.set_ylim(-3, 3)
  ax.set_zlim(0., 1.5)
  
  ax.set_xlabel('x')
  ax.set_ylabel('y')
  ax.set_zlabel('z')
  </code></pre>
  
  <p>The resulting figure has a dark green line with amplitude a bit below 0.8 on both the "x" and "y" projections, which does not exist in my "rect_2D" variable. Does anyone knows if this is a bug or if there is a mistake in my code? Any suggestions on how to get rid of it? Thanks in advance!</p>