title: Common origin in matplotlib figures
body: <p>I am constructing a 3D scatter plot using matplotlib, but cannot get the figure produced to have a common origin for all 3 axes. How can I do this?</p>
  
  <p>My code (so far), i haven't implemented any definitions for the axes specifications because i'm very new to Python:</p>
  
  <pre><code>  from mpl_toolkits.mplot3d.axes3d import Axes3D
    import matplotlib.pyplot as plt
  
  
    # imports specific to the plots in this example
    import numpy as np
    from matplotlib import cm
    from mpl_toolkits.mplot3d.axes3d import get_test_data
  
    def randrange(n, vmin, vmax):
    return (vmax-vmin)*np.random.rand(n) + vmin
  
    # Same as wide as it is tall.
    fig = plt.figure(figsize=plt.figaspect(1.0))
  
  
    ax = fig.add_subplot(111, projection='3d')
  
    n = 512
  
    xs = np.random.randint(0, 10, size=n)
    ys = np.random.randint(0, 10, size=n)
    zs = np.random.randint(0, 10, size=n)
    colors = np.random.randint(0, 10, size=n)
    scat = ax.scatter(xs, ys, zs, c=colors, marker='o')
  
    ax.set_xlabel('X Label')
    ax.set_ylabel('Y Label')
    ax.set_zlabel('Z Label')
  
  
    fig.colorbar(scat, shrink=0.5, aspect=10)
  
    plt.show()
  </code></pre>