\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 2972 times
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
- Stefan Kottwitz
- Site Admin
- Posts: 10335
- 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 2952 times