我想在两个节点之间画一个弯曲的箭头。按照这个帖子中的第一个答案TikZ 中的简单曲线我尝试了以下代码,但箭头指向相反的方向……我该如何解决?谢谢!
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\node (A) at (0,0) {\includegraphics[scale=.1]{images/presentation/2/cell.png}};
\node (B) at (8,-1) {\includegraphics[scale=.1]{images/presentation/2/cell2.png}};
\draw[->, >=latex, blue, line width=6pt] (A.east) to (B.west);
\draw [->, cyan, line width=3pt] plot [smooth, tension=1] coordinates{ ([yshift=.5cm]A.east) (2,2.5) (4,2) (6,3) ([yshift=.5cm]B.west)}; %this arrow head should point to the other side
\end{tikzpicture}
\end{document}
答案1
to
我认为这是与路径相同的问题箭头和多部分矩形的奇怪行为
因此 TikZ 需要稍微推动一下才能恢复路径方向。
\documentclass[tikz]{standalone}
\usepackage{mwe}%<-- For dummy images
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}
\node (A) at (0,0) {\includegraphics[scale=.1]{example-image-a}};
\node (B) at (8,-1) {\includegraphics[scale=.1]{example-image-b}};
\draw[->, >=latex, blue, line width=6pt] (A.east) to (B.west);
\draw [->,cyan, line width=3pt]
plot [smooth, tension=1] coordinates{%
([yshift=.5cm]A.east)
(2,2.5)
(4,2)
(6,3)
([yshift=5mm+5pt]B.west)}
--([yshift=5mm]B.west);
\end{tikzpicture}
\end{document}