title: How to draw random planes
body: <p>I am using the following code to draw random planes in 3d that go through the origin.</p>
  
  <pre><code>from __future__ import division
  import numpy as np
  import matplotlib.pyplot as plt
  from mpl_toolkits.mplot3d import Axes3D
  
  #Number of hyperplanes
  n = 20
  #Dimension of space
  d = 3
  
  plt3d = plt.figure().gca(projection='3d')
  for i in xrange(n):
      #Create random point on unit sphere
      v = np.random.normal(size = d)
      v = v/np.sqrt(np.sum(v**2))
      # create x,y
      xx, yy = np.meshgrid(range(-5,5), range(-5,5))
      z = (-v[0] * xx - v[1] * yy)/v[2]
      # plot the surface
      plt3d.plot_surface(xx, yy, z, alpha = 0.5)
  plt.show()
  </code></pre>
  
  <p>But looking at the picture I don't believe they are uniformly chosen. What am I doing wrong?</p>