I want to add a legend to my graph, explaining what different arrows mean.
I thought I might be able to do it using coordinates, but the spaces between them are the same as spaces between the nodes in the graph itself, and I want only a short distance between them. I know there is a simple way but I can’t figure it out.
Also how do I add writing next to the arrow, explaining its purpose, and labelling the legend as such?
begin{tikzpicture}[
> = stealth, % arrow head style
shorten > = 1pt, % don't touch arrow head to node
auto,
node distance = 3cm, % distance between nodes
semithick % line style
]
tikzstyle{every state}=[
draw = black,
thick,
fill = white,
minimum size = 10mm
]
node[state] (A) {$A$};
node[state] (B) [right of=A] {$B$};
node[state] (C) [below of=A] {$C$};
tikzset{mystyle/.style={->,line width=2pt}}
coordinate[below of=C] (d2);
coordinate[right of=d2] (d3);
coordinate[below of=d2] (d4);
coordinate[right of=d4] (d5);
path[->] (A) edge node {} (B);
path[->] (A) [mystyle] edge node {} (C);
path[->] (d2) edge node {} (d3);
path[->] (d4) [mystyle] edge node {} (d5);
end{tikzpicture}