title: How to plot vectors in python using matplotlib
body: <p>I am taking a course on linear algebra and I want to visualize the vectors in action, such as vector addition, normal vector, so on. </p>
  
  <p>For instance: </p>
  
  <pre><code>V = np.array([[1,1],[-2,2],[4,-7]])
  </code></pre>
  
  <p>In this case I want to plot 3 vectors <code>V1 = (1,1), M2 = (-2,2), M3 = (4,-7)</code>.</p>
  
  <p>Then I should be able to add V1,V2 to plot a new vector V12(all together in one figure).</p>
  
  <p>when I use the following code, the plot is not as intended</p>
  
  <pre><code>import numpy as np
  import matplotlib.pyplot as plt
  M = np.array([[1,1],[-2,2],[4,-7]])
  
  print("vector:1")
  print(M[0,:])
  # print("vector:2")
  # print(M[1,:])
  rows,cols = M.T.shape
  print(cols)
  
  for i,l in enumerate(range(0,cols)):
      print("Iteration: {}-{}".format(i,l))
      print("vector:{}".format(i))
      print(M[i,:])
      v1 = [0,0],[M[i,0],M[i,1]]
      # v1 = [M[i,0]],[M[i,1]]
      print(v1)
      plt.figure(i)
      plt.plot(v1)
      plt.show()
  </code></pre>