I'm working on a series of (linguistic) diagrams in which node
s are connected by lines. Some lines need to bend to go around other node
s. Each diagram has 16 node
s and lots of lines (>50
).
Ideally, I'd be able to draw some lines in two colors. I'd like to do them side-by-side, and I can't figure out a way to achieve that (at least, in a way that scales easily for many lines).
Here's a minimal example showing the sort of line I'd like to get:
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\coordinate (one) at (2,0);
\coordinate (oneb) at (2,0.05);
\coordinate (two) at (0,0);
\coordinate (three) at (-2,0);
\coordinate (threeb) at (-2,0.05);
\path (one) edge[blue, very thick, bend left=40] (three);
\path (oneb) edge[red, very thick, bend left=40] (threeb);
\path (three) edge[red, very thick, bend left=40] (one);
\filldraw[draw=black,fill=white] (one) circle (0.2in);
\filldraw[draw=black,fill=white] (two) circle (0.2in);
\filldraw[draw=black,fill=white] (three) circle (0.2in);
\node at (one) {one};
\node at (two) {two};
\node at (three) {three};
\end{tikzpicture}
\end{document}
This results in the following:
This method (defining new coordinates) works well enough when there's only one line to draw, but it's not feasible when there are many lines in many different directions.
Is there a simpler way to define a two-color edge like the lower line in the above example?
Best Answer
I have a tricky way using
postaction
If you found wedge-like ends annoying, you may also cover them by nodes.