I'm trying to plot some annotations to go along with my step function graphs. I currently have these graphs, and I've been trying to figure out how to draw horizontal arrows that point towards vertical lines. I will also need labeled, vertical lines that are pointing towards horizontal lines.
I have attached an image that shows (in red) what I mean. I've tried the annotation() function, but it's truly a pain to get the arrows where I want them to be. If anyone wouldn't mind explaining how to use that function, or alternative methods for what I'm trying to achieve, that would be amazing!
EDIT: Is there a way to edit the Quiver arrowhead size?
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. Thequiver()
function takes in a few inputs in this case. In the full script below I used twice the amount ofquiver()
calls to plot overlapping arrows to create a double headed arrow.Function Call:
•
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 arraySetting the Maximum Size of the Arrow Head:
The maximum size of the arrow head can be set by using the
'MaxHeadSize'
property.