如何在我的箭头中添加标签?

如何在我的箭头中添加标签?

我有以下代码:

\begin{tikzpicture}
\node (A) at (0, 0) [shape=circle,draw] {$\BC^n$};
\node (B) at (4, 0) [shape=circle,draw] {$\BC$};
\draw [->] (A) to [out=60,in=120, bend right]  (B);
\draw [->] (B) to [out=60,in=120, bend right ] (A);
 \path[->]  (A) edge [out=140,in=80,looseness=12]  (A);
 \path[->] (A) edge [out=-190,in=230,looseness=12] (A);
\end{tikzpicture}

我想为箭头添加标签,但插入{some label}选项时编译时出现错误。有什么解决办法吗?

答案1

这里有两种绘制标记图的方法。

enter image description here

\documentclass[border=2mm]{standalone}
\newcommand\BC{X}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
\begin{tikzpicture}[baseline=(A.base)]
\node (A) at (0, 0) [shape=circle,draw] {$\BC^n$};
\node (B) at (4, 0) [shape=circle,draw] {$\BC$};
\draw [->] (A) to [out=60,in=120, bend right] node[below]{a}  (B);
\draw [->] (B) to [out=60,in=120, bend right ] node[above]{b} (A);
 \path[->]  (A) edge [out=140,in=80,looseness=12] node[above]{c}  (A);
 \path[->] (A) edge [out=-190,in=230,looseness=12] node[below]{d} (A);
\end{tikzpicture}
\qquad
\begin{tikzpicture}%
  [baseline=(A.base),
   vertex/.style={circle,draw,inner sep=2pt,minimum size=2em},
   auto,>=stealth
  ]
  \node[vertex] (A) {$\BC^n$};
  \node[vertex,right=2cm of A] (B) {$\BC$};
  \path[->] (A) edge[bend right] node[swap]{a} (B)
                edge[loop above] node{c} (A)
                edge[loop left]  node{d} (A)
            (B) edge[bend right] node[swap]{b} (A);
\end{tikzpicture}
\end{document}

答案2

就我而言,它适用于以下代码:

    \draw [axis,<->] (0,2.5) node (yaxis) [above] {F}
|- (2.75,0) node (xaxis) [right] {u};

对于轴线或线:

\draw[dashed] (0.6,0) node[below] {$u_1$} -| (0.6,0.9) node[below] {};

相关内容