从支撑到节点的箭头

从支撑到节点的箭头

我想从花括号的尖端画一个指向节点的箭头,但如果我执行以下操作,则会在括号尖端上方画一个额外的箭头。

\documentclass{article}
\usepackage{pgfplots}
\begin{document}
\usetikzlibrary{decorations.pathreplacing}
\begin{tikzpicture}
  \node (A) at (0,0) {Hello};
  \draw[decorate, decoration={brace, amplitude=10pt}] (2.2,-1.8) -- coordinate [left=10pt] (B) (2.2,-0.3) node {};
  \draw[-latex] (B) edge (A);
\end{tikzpicture}
\end{document}

看起来很奇怪,我不知道这个额外的箭头是怎么来的。如果我像这样交换 B 和 A \draw[-latex] (A) edge (B);,则只会绘制一个箭头,有人可以解释这一点并解释如何正确执行上述操作吗?

答案1

我认为问题在于使用edge哪种方法会产生第二种结构绘制了主路径。由于[-latex]适用于整个命令直到;,因此最终得到 2 个箭头。edge用常规替换--可消除此问题:

\documentclass[tikz]{standalone}
\usetikzlibrary{decorations.pathreplacing}
\begin{document}

\begin{tikzpicture}
  \node (A) at (0,0) {Hello};
  \draw[decorate, decoration={brace, amplitude=10pt}] (2.2,-1.8) -- coordinate [left=10pt] (B) (2.2,-0.3) node {};
  \draw[-latex] (B) -- (A);
\end{tikzpicture}

\end{document}

单箭头

相关内容