title: How to plot a multivariate function in Python?
body: <p>Plotting a single variable function in Python is pretty straightforward with <code>matplotlib</code>. But I'm trying to add a third axis to the scatter plot so I can visualize my multivariate model.</p>
  
  <p>Here's an example snippet, with 30 outputs:</p>
  
  <pre><code>import numpy as np
  np.random.seed(2)
  ## generate a random data set
  x = np.random.randn(30, 2)
  x[:, 1] = x[:, 1] * 100
  y = 11*x[:,0] + 3.4*x[:,1] - 4 + np.random.randn(30) ##the model
  </code></pre>
  
  <p>If this was just a single variable model I'd probably use something like this to generate a plot &amp; line of best fit:</p>
  
  <pre><code>%pylab inline
  import matplotlib.pyplot as pl 
  pl.scatter(x_train, y_train)
  pl.plot(x_train, ols.predict(x_train))
  pl.xlabel('x')
  pl.ylabel('y')
  </code></pre>
  
  <p>What's the equivalent for multivariate visualization?</p>