title: ValueError: Argument U has a size 4 which does not match 1, the number of arrow positions
body: <p><strong>Code:</strong></p>
  <pre><code>import numpy as np
  import matplotlib.pyplot as plt
  from matplotlib import colors
  import math as mt
  from numpy import linalg as LA
  from mpl_toolkits.mplot3d import Axes3D
  from sklearn.datasets import fetch_olivetti_faces
  %matplotlib inline
  
  x=np.array([1,0]) # Original vector
  theta = 30 * mt.pi / 180 # 30 degress in radian
  A = np.array([[np.cos(theta), -np.sin(theta)],[np.sin(theta), np.cos(theta)]]) # Rotation matrix for theta=30 degrees
  B = np.array([[3,0],[0,1]]) # Stretching matrix
  
  Ax = A @ x  # y1 is the rotated vector
  Bx = B @ x  # y2 is the stretched vector
  
  # Reshaping and storing both x and Ax in t1 to be plotted as vectors
  t1 = np.concatenate([x.reshape(1,2), Ax.reshape(1,2)])
  # Reshaping and storing both x and Bx in t2 to be plotted as vectors
  t2 = np.concatenate([x.reshape(1,2), Bx.reshape(1,2)])
  
  # origin point
  x_pos = 0
  y_pos = 0
  
  fig, ax = plt.subplots()
  
  
  # Plotting t1
  ax1.quiver(x_pos, y_pos, t1[:,0], t1[:,1], color=['b', 'g'], width=0.013, angles='xy', scale_units='xy', scale=1)
  ax1.set_xlabel('x', fontsize=14)
  ax1.set_ylabel('y', fontsize=14)
  ax1.set_xlim([-0.5,1.5])
  ax1.set_ylim([-0.5,1])
  ax1.set_aspect('equal')
  ax1.grid(True)
  ax1.set_axisbelow(True)
  ax1.set_title(&quot;Rotation transform&quot;)
  ax1.axhline(y=0, color='k')
  ax1.axvline(x=0, color='k')
  ax1.text(1, 0.1, &quot;$\mathbf{x}$&quot;, fontsize=16)
  ax1.text(0.8, 0.6, &quot;$\mathbf{Ax}$&quot;, fontsize=16)
  
  
  plt.show()
  </code></pre>
  <p>I am trying to plot vectors after transformation using python and jupyter notebook. I am new in both. My code giving me error message after using <code>ax1.quiver</code> method.</p>
  <p><strong>Error message:</strong></p>
  <pre><code>ValueError                                Traceback (most recent call last)
  &lt;ipython-input-20-f96b87a2142a&gt; in &lt;module&gt;
       29 
       30 # Plotting t1
  ---&gt; 31 ax1.quiver(x_pos, y_pos, t1, t1, color=['b', 'g'], width=0.013, angles='xy', scale_units='xy', scale=1)
       32 ax1.set_xlabel('x', fontsize=14)
       33 ax1.set_ylabel('y', fontsize=14)
  
  ~/python-project/linear-algebra/py3env/lib/python3.7/site-packages/matplotlib/__init__.py in inner(ax, data, *args, **kwargs)
     1436     def inner(ax, *args, data=None, **kwargs):
     1437         if data is None:
  -&gt; 1438             return func(ax, *map(sanitize_sequence, args), **kwargs)
     1439 
     1440         bound = new_sig.bind(ax, *args, **kwargs)
  
  ~/python-project/linear-algebra/py3env/lib/python3.7/site-packages/matplotlib/axes/_axes.py in quiver(self, *args, **kw)
     5019         args = self._quiver_units(args, kw)
     5020 
  -&gt; 5021         q = mquiver.Quiver(self, *args, **kw)
     5022 
     5023         self.add_collection(q, autolim=True)
  
  ~/python-project/linear-algebra/py3env/lib/python3.7/site-packages/matplotlib/quiver.py in __init__(self, ax, scale, headwidth, headlength, headaxislength, minshaft, minlength, units, scale_units, angles, width, color, pivot, *args, **kw)
      501                                              **kw)
      502         self.polykw = kw
  --&gt; 503         self.set_UVC(U, V, C)
      504         self._initialized = False
      505 
  
  ~/python-project/linear-algebra/py3env/lib/python3.7/site-packages/matplotlib/quiver.py in set_UVC(self, U, V, C)
      574         for name, var in zip(('U', 'V', 'C'), (U, V, C)):
      575             if not (var is None or var.size == self.N or var.size == 1):
  --&gt; 576                 raise ValueError(f'Argument {name} has a size {var.size}'
      577                                  f' which does not match {self.N},'
      578                                  ' the number of arrow positions')
  
  ValueError: Argument U has a size 4 which does not match 1, the number of arrow positions
  </code></pre>
  <p>I searched google on this type of error message but I didn't get any helpful solution to solve. I don't understand what message is telling me to do correction.</p>