Graphics, Figures & Tables ⇒ Specific Drawings with Arrows and Vertices
Specific Drawings with Arrows and Vertices
I would like to know how to draw the pictures from the attachment in LaTeX.
I tried all the basic stuff using coordinates and smooth lines etcetera but the resulting pictures are terrible!
All hints, tips and trick will be very much appreciated.
Kind regards,
Lemon
- Attachments
-
- Configurations.pdf
- (130.05 KiB) Downloaded 218 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
Specific Drawings with Arrows and Vertices
Welcome to the forum!
Please show what you tried, so we can help to improve it.Lemon wrote:I tried all the basic stuff using coordinates and smooth lines etcetera but the resulting pictures are terrible!
Stefan
Specific Drawings with Arrows and Vertices
Thank you for your response. I now have this:
Code: Select all
\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage{tikz}
\usetikzlibrary{arrows}
\begin{document}
\begin{figure}[!ht]
\centering
\begin{tikzpicture}[
auto=left,
every node/.style={
circle,
draw,
fill=black,
text=white,
scale=1.0
}
]
\node (A) at (0, 0) {A};
\node (B) at (0, 2) {};
\node (C) at (0, 4) {};
\node (D) at (-2, 6) {};
\node (E) at (2, 6) {};
\foreach \from/\to in {A/B, B/C, C/D, C/E}
\draw (\from) -- (\to)[black];
\draw [blue, very thick] plot [smooth] coordinates {(-2,6) (-3,5) (0,2)};
\draw [red, dashed] plot [smooth] coordinates {(2,6) (3,7) (4,5) (3,3) (0,0)};
\node [fill=none, draw=none, text=black] (X1) at (2, 1) {$e_1$};
\end{tikzpicture}
\caption{Example}
\label{fig:xample}
\end{figure}
\end{document}
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Specific Drawings with Arrows and Vertices
Regarding the problem, you can try something like this. Click on "Open in writeLaTeX" in the below code box to see the output instantly.Board Rules wrote:A crossposting is always contra-productive. But there is nothing really against it as long as it is mentioned. This means that a direct link has to be added. So other users who want to help are preserved from double efforts and waste of time.
Code: Select all
\documentclass[11pt]{standalone}
\usepackage[T1]{fontenc}
\usepackage{tikz}
\usetikzlibrary{arrows}
\begin{document}
\begin{tikzpicture}[
>=stealth,
auto,
point/.style={
circle,
draw,
fill=black,
text=white,
scale=1.0
}
]
\node[point] (A) at (0,0) {A};
\node[point] (B) at (0,2) {};
\node[point] (C) at (0,4) {};
\node[point] (D) at (-2,6) {};
\node[point] (E) at (2,6) {};
\foreach \from/\to in {A/B, B/C, C/D, C/E}
\draw (\from) -- (\to)[black];
\draw[->,blue,very thick] (D.135) .. controls +(left:2) and +(left:2) .. (B);
\draw [->,red,dashed] (E.45) .. controls +(right:2) and +(right:2) .. node[midway,black] (e1) {$e_1$} (A);
\end{tikzpicture}
\end{document}
Best regards and welcome to the board
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10