# How can one "shorten" arrows to be drawn between two points but being a bit hemmed in, as not to overlap with the plot markers?

The problem arises when you want to connect two point markers in a diagram with an arrow. Just giving the ccordinates of the points to the arrow results in ugliness, as the arrow then overlaps with the point markers:

whereas one might one to "hem in" the arrow on both ends a bit:

• From the documentation, "Arrow[{pt1, pt2}, {s1,s2}] sets back s1 from pt1 and s2 from pt2." Using s instead of {s1, s2} uses the same offset for the arrow head and tail. Aug 18, 2020 at 12:06

You can use the undocumented functions DynamicLocation and and DynamicName to do this (see this answer for more details):

Graphics[
{
Arrow[{
DynamicLocation["ID1", Automatic, Center],
DynamicLocation["ID2", Automatic, Center]
}],
Red,
DynamicName[Disk[{0,0},.1],"ID1"],
DynamicName[Disk[{1,1},.2],"ID2"]
}
]


Ok, here is a small utility function that I named shortenedArrows

Clear[ shortenedArrow];
shortenedArrow[ {p1_, p2_}, {s1_, s2_}] := Module[ {v, a, b},
v = p2 - p1;
a = p1 + s1 v;
b = p1 + (1 - s2) v;
Return[ Arrow[{a, b}]]
];
shortenedArrow[ {p1_, p2_}, s_: 0.05] :=
shortenedArrow[ {p1, p2}, {s, s}];


The function can be used like Arrow but accepts an (optional) additional parameter that indicates by what fraction the arrow should be hemmed in. If the optional parameter is a list, it gives the fractional shortening at the beginning and the end of the arrow.

The two graphs above are created via

Function[{p1, p2},
Graphics[{Dashed, Red, Disk[#, 0.1] & /@ {p1, p2}, Black,
shortenedArrow[{p1, p2}, 0.0] }]][ {0, 0}, {1, 1}]


and

Function[{p1, p2},
Graphics[{Dashed, Red, Disk[#, 0.1] & /@ {p1, p2}, Black,
shortenedArrow[{p1, p2}, 0.1] }]][ {0, 0}, {1, 1}]


respectively.