如何在 tikz 中的箭头顶部显示标签

如何在 tikz 中的箭头顶部显示标签

我有这个tikz数字:

\begin{figure}
   \centering
   \begin{tikzpicture}[start chain=going right,>=latex,node distance=0pt]
     \node[draw,rectangle,on chain,minimum size=1cm] (rr) {$I$};
     \node[draw,rectangle,on chain,draw=white,minimum size=1cm]{};
     % the rectangular shape with vertical lines
     \node[rectangle split, rectangle split parts=4,
     draw, rectangle split horizontal,text height=0.5cm,text depth=0.5cm,on chain,inner ysep=0pt] (wa) {};
     \fill[white] ([xshift=-\pgflinewidth,yshift=-\pgflinewidth]wa.north west) rectangle ([xshift=-15pt,yshift=\pgflinewidth]wa.south);
     % the circle
     \node[draw,circle,on chain,minimum size=1cm] (se) {$U$};
     \node[draw,rectangle,on chain,draw=white,minimum size=1cm]{};
     % rect2
     \node[rectangle split, rectangle split parts=4,
     draw, rectangle split horizontal,text height=0.5cm,text depth=0.5cm,on chain,inner ysep=0pt] (wa2) {};
     % the circle 2
     \node[draw,circle,on chain,minimum size=1cm] (se2) {$U$};
     % the arrows and labels
     \draw[->] (se.east) -- +(20pt,0) node[right] {$\mu$};
     \draw[->] (se2.east) -- +(20pt,0) node[right] {$\mu$};
     \draw[<-] (wa.west) -- +(-20pt,0) node[left] {$\lambda$};
     \node[align=center,below] at (rr.south) {Input \\ process};
     \node[align=center,below] at (wa.south) {Queue \\ subsystem};
     \node[align=center,below] at (se.south) {Server \\ process};
   \end{tikzpicture}
      \caption{The model represented as a queuing system.}
         \label{fig:queue}
   \end{figure}

在此处输入图片描述

chains也在用。

我想在箭头上方显示标签...该怎么做?

答案1

命令

\draw[->] (se.east) -- +(20pt,0) node[right] {$\mu$};

放置$\mu$在最后一个坐标的右侧。要将其放置在第一个坐标和最后一个坐标之间的某个位置,可以使用pos=x0 <= x <= 1任何等效表达式near start, near end, midway, ...。最后,要将其移动到线上,请使用above

\draw[->] (se.east) -- +(20pt,0) node[midway, above] {$\mu$};

相关内容