Using Quiver in a 2D Subplot
Not quite sure if this is any better or simpler but I used the quiver()
function to plot the lines shown below. The quiver()
function takes in a few inputs in this case. In the full script below I used twice the amount of quiver()
calls to plot overlapping arrows to create a double headed arrow.

Function Call:
quiver(Start_Point(1),Start_Point(2),X_Displacement,Y_Displacement,0);
• Start_Point
→ equal to [x y]
(x-coordinate y-coordinate)
• Start_Point(1)
→ The x-coordinate of the arrow's start
• Start_Point(2)
→ The y-coordinate of the arrow's start
• X_Displacement
→ The horizontal distance from the start of the array
• Y_Displacement
→ The vertical distance from the start of the array
Setting the Maximum Size of the Arrow Head:
The maximum size of the arrow head can be set by using the 'MaxHeadSize'
property.
clf;
Start_Point(1) = 0;
Start_Point(2) = 0;
X_Displacement = 0; Y_Displacement = 10;
Magnitude = sqrt(X_Displacement.^2 + Y_Displacement.^2);
quiver(Start_Point(1),Start_Point(2),X_Displacement,Y_Displacement,0,'Color','r','MaxHeadSize',1/Magnitude);
hold on
Start_Point(1) = 0;
Start_Point(2) = 0;
X_Displacement = 100; Y_Displacement = 0;
Magnitude = sqrt(X_Displacement.^2 + Y_Displacement.^2);
quiver(Start_Point(1),Start_Point(2),X_Displacement,Y_Displacement,0,'Color','r','MaxHeadSize',1/Magnitude);