I have a problem with placing a node on a path drawn between two nodes in a TikZ matrix. I want to show the correspondence between the edge of a directed graph and entries of its adjacency matrix. My plan was to draw a dotted arrow between an edge of a digraph and the associated entry of its adjacency matrix.
I have two problems, one big, one small. The biggest one is that in the MWE below I cannot correctly place a node on the curved edge between E and C.
\draw[blue,thick] (E) to [bend right] (C);
\node (ece) [pos=0.2] {} (E) -- (C); % (ece) is nowhere the edge :-(
A smaller problem for me is that I don't get why the node (mdag)-3-3 isn't drawn with a circle; it does get drawn in blue.
Here follows the full MWE.
Many thanks.
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{matrix}
\begin{document}
\begin{tikzpicture}[>=stealth,->,shorten >=2pt,looseness=.5,auto]
\matrix (dag) [matrix of nodes,%
nodes={outer sep=0pt,circle,minimum size=4pt,draw},
column sep={2cm,between origins},
row sep={2cm,between origins},
ampersand replacement=\&] {
|(A)| A \& |(C)| C \\
|(D)| D \& |(E)| E \\
};
\draw (D) to [bend left] (A);
\draw (E) to [bend right] (A);
\draw[blue,thick] (E) to [bend right] (C);
\node (ece) [pos=0.2] {} (E) -- (C); % (ece) is nowhere the edge :-(
\matrix (mdag) at ([xshift=3cm]C.north east)
[matrix of math nodes,
anchor=TL.north west,
every node/.style={font={\large\ttfamily}},
row 3 column 3/.style={circle,blue}] {
|(TL)| & A & C \\
D & 1 & 0 \\
E & 1 & |(mce)| 1 \\
};
\draw[blue,fill] (ece) circle (1.5pt);
\draw[dotted] (ece) to [bend right] (mce.center);
\end{tikzpicture}
\end{document}

--with the node placement one;)Feel free to upvote if the answer helped (which obviously, it does, since you accepted !) – marsupilam Sep 01 '17 at 19:23