我正在尝试使用此 tikz 库创建信号流图。我对 tikz 非常陌生,不知道如何将标题移动到节点上方。alpha 隐藏在左下角节点的箭头下。我已经尝试过了,label=above:
但编译失败。
https://github.com/kitmonisit/signalflow
\begin{tikzpicture}
[every node/.style={anchor=center}]
\matrix (m) [minimum width=6in,
row sep=10mm,
column sep=10mm]
{%
% row 1
\node[input] (in)
{$x[n]$}; &
\node[node] (tap)
{}; &&&
\node[adder] (adder)
{}; &
\node[output] (out)
{$y[n]$}; \\
% row 2
&
&
\node[block] (delay)
{$z^{-k}$}; &
\node[multiplier] (factor)
{$\alpha$}; &&
\\
};
\path[r>] (in) -- (tap);
\path[r>] (tap) -- (adder);
\path[r>] (adder) -- (out);
\path[r>] (tap) |- (delay);
\path[r>] (delay) -- (factor);
\path[r>] (factor) -| (adder);
\end{tikzpicture}
答案1
我找到了解决方案。必须用
{\nodepart{above}{$\alpha$}}; &&
如这里所述
https://texample.net/tikz/examples/signal-flow-building-blocks/
现在看起来像这样