如何在图表上制作弯曲的箭头?

如何在图表上制作弯曲的箭头?

我正在尝试制作这样的图表,但我无法在中心画出弯曲的箭头。

在此处输入图片描述

以下是我所拥有的:

\begin{figure}
\centering
\begin{tikzpicture}
%% vertices
\draw[fill=black] (0,0) circle (3pt);
\draw[fill=black] (1,0) circle (3pt);
\draw[fill=white] (2,0) circle (3pt);

\draw[fill=black] (3.3,0) circle (3pt);
\draw[fill=black] (4.3,0) circle (3pt);
\draw[fill=white] (5.3,0) circle (3pt);

\draw[fill=white] (6.6,0) circle (3pt);
\draw[fill=white] (7.6,0) circle (3pt);
\draw[fill=black] (8.6,0) circle (3pt);
%% vertex labels
\node at (0, .8) {1};
\node at (0, -.3) {x};
\node at (1, -.3) {y};
\node at (2, -.3) {z};

\node at (3.3, .8) {2};
\node at (3.3, -.3) {x};
\node at (4.3, -.3) {y};
\node at (5.3, -.3) {z};

\node at (6.6, .8) {3};
\node at (6.6, -.3) {x};
\node at (7.6, -.3) {y};
\node at (8.6, -.3) {z};

%%% edges
\draw[thick] (0,0) -- (1,0) -- (1.9,0);
\draw[thick] (3.3,0) -- (4.3,0) -- (5.2,0);
\draw[thick] (6.7,0) -- (7.5,0);
\draw[thick] (7.7,0) -- (8.6,0);
\end{tikzpicture}
\caption{Existe una jugada entre el tablero 1 y el tablero 3.}
\end{figure}

看起来像这样:

在此处输入图片描述

答案1

您可以使用edge

\draw[red, dotted, thick, shorten >=3pt, shorten <=3pt]  
    (X2) edge[out=45, in=135, -stealth] (Z2);

得出

在此处输入图片描述

建议:

  • 用于\coordinates定义具有名称的点。在下面的代码中,我定义了坐标(X2)(Z2)
  • \nodes使用命名坐标放置并使用\tikzset定义样式来调整\node标签相对于坐标的位置。我定义了样式Node Position来指定标签的位置。

代码:

\documentclass{article}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
\coordinate (X2) at (3.3, 0);
\coordinate (Z2) at (5.3, 0);

\tikzset{Node Position/.style={yshift=-0.3cm}}

%% vertices
\draw[fill=black] (0,0) circle (3pt);
\draw[fill=black] (1,0) circle (3pt);
\draw[fill=white] (2,0) circle (3pt);

\draw[fill=black] (X2) circle (3pt);
\draw[fill=black] (4.3,0) circle (3pt);
\draw[fill=white] (Z2) circle (3pt);

\draw[fill=white] (6.6,0) circle (3pt);
\draw[fill=white] (7.6,0) circle (3pt);
\draw[fill=black] (8.6,0) circle (3pt);
%% vertex labels
\node at (0, .8) {1};
\node at (0, -.3) {x};
\node at (1, -.3) {y};
\node at (2, -.3) {z};


\node at (3.3, .8) {2};
\node [Node Position] at (X2) {x};
\node at (4.3, -.3) {y};
\node [Node Position] at (Z2) {z};

\draw[red, dotted, thick, shorten >=3pt, shorten <=3pt]  (X2) edge[out=45, in=135, -stealth] (Z2);

\node at (6.6, .8) {3};
\node at (6.6, -.3) {x};
\node at (7.6, -.3) {y};
\node at (8.6, -.3) {z};

%%% edges
\draw[thick] (0,0) -- (1,0) -- (1.9,0);
\draw[thick] (3.3,0) -- (4.3,0) -- (5.2,0);
\draw[thick] (6.7,0) -- (7.5,0);
\draw[thick] (7.7,0) -- (8.6,0);
\end{tikzpicture}
\end{document}

相关内容