title: making 45 degree vectors in matplotlib
body: <p>I am trying to make 45 degree vector arrows in a chart using the snippet of matplotlib python code:</p>
  
  <pre><code>soa_tau = []
  
  def my_range(start, end, step):
  while start &lt;= end:
      yield start
      start += step
  
  fig, axes = plt.subplots(nrows=1, ncols=6, figsize=(11, 8.5))
  plt.subplots_adjust(bottom=0.2, top=0.8, left=0.07, right=0.97, wspace=0.4)
  
  a=0
  
  for tau in range(0,121,24):
      if (tau==0):    
      depth_count= []
  soa = []
  for h in my_range(0,600,100):
      if (tau==0):
          depth_count.append(-h)
      xvect=0.125
      yvect=0.125
      result = [0.2,-h,xvect,yvect]
  
      soa.append(result)
      a=a+1;
  soa_tau.append(soa)
  
  axes[0].set_ylabel('depth (m)')
  aa=0
  for ax in axes:
      soa=soa_tau[aa]
      X,Y,U,V = zip(*soa)
      ax.quiver(X,Y,U,V,angles='xy',width=0.003,headwidth=0.4,color='r',scale=1,zorder=2)
      ax.tick_params(axis='both',which='major', labelsize=6)
      ax.set_xlabel('Speed (m/s)')
  
      aa=aa+1
  
  plt.savefig('test.pdf')
  </code></pre>
  
  <p>Now I am trying to produce the following figure: <a href="https://i.stack.imgur.com/aSl0L.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aSl0L.png" alt="enter image description here"></a></p>
  
  <p>However as you can see in the figure the vectors are flat lines.  I am trying to make the lines be at 45 degree angles which is what I would expect from the x and y components of the vectors being equal.  My guess is having the multiple figures complicated things.  However I still need to have these figures available.  Is there any way that this code can be tweaked so that the vectors display at 45 degrees instead of 0 degrees as shown in the figure?  I also want to be able to maintain the length of the vectors as shown in the figure. </p>