
Respuesta1
Para ayudarte a comenzar con TikZ, aquí tienes una solución rápida que reproduce tu diseño dibujado a mano. No dudes en adaptarlo.
En el futuro, considere agregar unejemplo de trabajo mínimo (MWE)que ilustra su problema, comenzando \documentclass{...}
y terminando con \end{document}
.
\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{chains}
\begin{document}
\begin{tikzpicture}[
start chain=going base right,
node distance=2cm,
every on chain/.append style=
{draw = violet,
circle,
inner sep=0pt,
minimum size=1cm,
line width=1pt,
font=\sffamily},
myedge/.style={line width=1pt, violet}]
\foreach \i in {1,...,6}
\node[on chain] (\i) {\i};
\foreach \i in {1,...,5}
{
\pgfmathtruncatemacro{\j}{\i+1}
\draw[myedge] (\i) -- (\j);
}
\draw[myedge] (1) to [out=90, in=0] ++(-2,3)
(2) to [out=90, in=180] ++(2,3)
(3) to [out=90, in=90, looseness=1.5] (4)
(5) to [out=90, in=180] ++(2,3);
\end{tikzpicture}
\end{document}
Respuesta2
Una pequeña variación de la agradable respuesta de @SebGlaw:
\documentclass[border=3.141592]{standalone}
\usepackage{tikz}
\usetikzlibrary{chains,
positioning}
\begin{document}
\begin{tikzpicture}[
node distance = 2cm, on grid,
start chain = going right, %
vertex/.style = {circle, draw = blue, thick,
minimum size=1em,
font=\sffamily,
on chain, join = by arr},
arr/.style = {draw=blue, semithick},
] ]
\foreach \i in {1,...,6}
\node[vertex] (\i) {\i};
\draw[arr] (1) edge [out=90, in=0] ++(-2,3)
(2) edge [out=90, in=180] ++( 2,3)
(3) edge [out=90, in=90,
min distance=15mm] (4)
(5) edge [out=90, in=180] ++(2,3);
\end{tikzpicture}
\end{document}
Respuesta3
Así es como un principiante podría abordar esto:
Primero, coloque los nodos en las coordenadas deseadas usando el \node
comando. Luego utilícelo \draw
para conectar nodos como desee. Describe to[out= , in=]
el ángulo hacia afuera y hacia adentro para obtener líneas curvas. Finalmente, ++(x,y)
describe las coordenadas relativas (derecha x
, arriba y
) del nodo.
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[every node/.style={circle, draw=blue, thick, inner sep=5pt}]
\node at (2,0)(A1){1};
\node at (4,0)(A2){2};
\node at (6,0)(A3){3};
\node at (8,0)(A4){4};
\node at (10,0)(A5){5};
\node at (12,0)(A6){6};
\draw[thick, blue] (A1)--(A2)--(A3)--(A4)--(A5)--(A6)
(A3) to[out=90, in=90] (A4)
(A1) to[out=90, in=0] ++(-1,2)
(A2) to[out=90, in=180] ++(1,2)
(A5) to[out=90, in=180] ++(1,2);
\end{tikzpicture}
\end{document}