连接节点的漂亮圆圈

连接节点的漂亮圆圈

我想知道如何使用 tikz 边缘获得漂亮的曲线。我不太理解度数弯曲的语义。使用以下代码:

\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{arrows,backgrounds, fit, calc, positioning}
\usepackage{multirow}
\begin{document}
\begin{frame}
\begin{tikzpicture}[align=center,node distance=2cm]
\tikzstyle{vertex}=[circle,draw=black]
\tikzstyle{fixed}=[-,dotted, shorten <=1pt,>=stealth',very thin]
\tikzstyle{followed}=[-,shorten <=1pt,>=stealth',thick]

\node[vertex] (v0) {$v_0$};
\node[vertex] (v1) [right of = v0] {$v_1$};
\node[vertex] (v2) [right of = v1] {$v_2$};

\path
    (v0) edge [followed] node[above, very near start] () {$2$} (v1)
    (v1) edge [followed] node[above, very near start] (v1derecha) {} node[above, very near end] (v2izquierda) {$4$} (v2);

\node [above = 0cm of v1] (v1content) {$6$};
\node [right = 0cm of v2] (v2content) {$2$};

\path
    (v1derecha.north) edge [->, bend right= 45] (v1content.east) {}
    (v2content.north) edge [->, bend right= 45] (v2izquierda.north) {};
\end{tikzpicture}
\end{frame}
\end{document}

我得到以下图片:

第一次尝试

或者如果我将其改为 90:

第二次尝试

所以我认为角度是相对于尖点的入射角(?)。无论如何,我得到的是完整的圆而不是扁平的圆吗?

答案1

好吧,感谢 AJN 和 smike,我最终做了类似的事情:

\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{arrows,backgrounds, fit, calc, positioning, bending}
\usepackage{multirow}
\begin{document}
\begin{frame}

\begin{tikzpicture}[align=center,node distance=2cm]
\tikzstyle{vertex}=[circle,draw=black]
\tikzstyle{followed}=[-,thick]

\node[vertex] (v0) {$v_0$};
\node[vertex] (v1) [right of = v0] {$v_1$};
\node[vertex] (v2) [right of = v1] {$v_2$};

\path
    (v0) edge [followed] node[above, very near start] () {$2$} (v1)
    (v1) edge [followed] node[above, very near start] (v1derecha) {} node[above, very near end] (v2izquierda) {$4$} (v2);

\node [above = 0cm of v1] (v1content) {$6$};
\node [right = 0cm of v2] (v2content) {$2$};

\path   (v1derecha.north) edge [->, bend right= 45] (v1content.east) {};
\draw[->]   (v2content.north) arc [start angle = 10, end angle = 140, radius = 0.65cm];
\end{tikzpicture}

\end{frame}
\end{document}

在此处输入图片描述

有点遗憾的是不能用边缘来完成,但最终结果相当不错。

相关内容