答案1
为了帮助你开始使用 Ti钾Z,这里有一个快速解决方案,可以重现您的手绘设计。请随意调整。
将来,请考虑添加最小工作示例(MWE)这说明了您的问题,以 开始\documentclass{...}
并以 结束\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}
答案2
与 @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}
答案3
初学者可以采用以下方法解决此问题:
首先,使用命令将节点放置在所需的坐标处\node
。然后使用\draw
根据需要连接节点。to[out= , in=]
描述向外的角度和向内的角度以获得曲线。最后,描述相对于节点的++(x,y)
相对坐标(右x
、上)。y
\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}