\foreach
loop. This would be easy if there were no directed edges at this picture.Graphics, Figures & Tables ⇒ tikZ | Parallel Edges between Nodes
tikZ | Parallel Edges between Nodes
- Attachments
-
- tikZ-parallel-edges.png (33.09 KiB) Viewed 3019 times
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- Stefan Kottwitz
- Site Admin
- Posts: 10350
- Joined: Mon Mar 10, 2008 9:44 pm
tikZ | Parallel Edges between Nodes
welcome to the board!
Actually every connection consists of three edges of the same type, so drawing edge, arrow to the left and to the right in one step of the
\foreach
loop could be a possibility.A different approach would be making three
\foreach
loops, one for the connecting edge, one for the arrows in one direction, with the label on it, and one for the other direction.Perhaps show, what you already got, if just the edges remain to be a problem.
Stefan
tikZ | Parallel Edges between Nodes
Well, this is what I currently have:
Code: Select all
\begin{scope}
\foreach \x/\y/\name/\label/\where in {1.2/1.4/a/{El Paso}/below, 1/3.2/b/Albuquerque
/above, 2.5/3/c/Amarillo/below, 3.8/4/d/Wichita/above, 4.3/3.3/e/Tulsa/45, 5.2/2.8/f/{Little Rock}/right, 4.2/2/g/Dallas/left, 4.8/1/h/Houston/right, 3.6/0.6/i/{San Antonio}/below} {
\draw (\x,\y) circle (.4mm);
\node[draw,circle,minimum size=2mm,inner sep=0mm,label=\where:{\footnotesize \label}] (\name) at (\x,\y) {};
}
\foreach \s/\t in {a/b, b/c, c/e, e/d, e/f, f/g, h/g, h/i}
\path[draw] (\s) edge (\t);
\end{scope}
- Attachments
-
- tikz.png (18.93 KiB) Viewed 2999 times