有人能帮我用我的代码在 Latex 中播放这个图像吗?
\begin{tikzpicture}
\draw [-] (0, 0) -- (4, 0) node [pos = .5, above] {$X_t$} node [pos = .5, below] {série de entrada};
\node (rectangle) [draw, rectangle, minimum width = 3 cm, minimum height = 3 cm] {filtro linear} node (Y) {} node [pos = .5, above] {$V(B)$};
\draw [-] (0, 0) -- (4, 0) node [pos = .5, above] {$Y_t$} node [pos = .5, below] {série de saída};
\end{tikzpicture}
答案1
改编:
- 给盒子命名:
(fl)
(filtro linear)并使用它来进行相对定位 - 使用位置在框上方
(fl.north)
书写。V(B)
- 在连接后立即写入节点(参见我的在这里回答) 代替
[pos = .5]
代码:
\documentclass[border=5pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}
\node[draw, rectangle, minimum width = 3 cm, minimum height = 2 cm] (fl) at (0,0) {filtro linear};
\node[above] at (fl.north) {$V(B)$};
\draw[-] (fl) -- node[above]{$X_t$} node[below]{série de entrada} ++(-4,0);
\draw[-] (fl) -- node[above]{$Y_t$} node[below]{série de saída} ++(4,0);
\end{tikzpicture}
\end{document}
答案2
绘画方法略有不同(看起来也不同):-)
使用库arrows.meta
和quotes
(如果您不喜欢输入和输出上的箭头,只需省略\draw
选项):
\documentclass[tikz, margin=3mm]{standalone}
\usetikzlibrary{arrows.meta, quotes}
\begin{document}
\begin{tikzpicture}[auto,
box/.style = {draw, minimum width=3cm, minimum height=2cm}
]
\node [box,label=$V(B)$] (fl) {filtro linear};
\draw [Triangle-] (fl.west) to ["$X_t$" ', "série de entrada"] + (-4,0);
\draw [-Triangle] (fl.east) to ["$Y_t$", "série de saída" '] + ( 4,0);
\end{tikzpicture}
\end{document}
答案3
几乎与 dexteritas 相同,只是线的长度实际上是 4 厘米。
\documentclass[border=5pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
\begin{tikzpicture}
\node (rectangle) [draw, rectangle, minimum width = 3 cm, minimum
height = 3 cm] (Y) at (4,0) {filtro linear} ;
\draw [-] (Y.west) -- ++ (-4, 0) node [pos = .5, above] {$X_t$} node [pos = .5, below]
{série de entrada};
\node [above=0.1cm of Y,anchor=south] {$V(B)$};
\draw [-] (Y.east) -- ++ (4, 0) node [pos = .5, above] {$Y_t$} node [pos = .5, below] {série de saída};
\end{tikzpicture}
\end{document}
答案4
尝试使用 MetaPost 及其boxes
软件包,可能会对它感兴趣。包含在 LuaLaTeX 程序中。
\documentclass[border=5mm]{standalone}
\usepackage{luatex85, luamplib}
\begin{document}
\begin{mplibcode}
input boxes;
beginfig(1);
boxit.f(btex filtro linear etex);
f.w = (4cm, 0); pair extr; extr = f.e + f.w;
f.e - f.w = (3cm, 0); f.n - f.s = (0, 2cm);
drawboxed(f);
draw origin -- f.w; draw f.e -- extr;
label.top(btex $V(B)$ etex, .5[f.nw,f.ne]);
label.top(btex $X_t$ etex, .5[origin,f.w]);
label.bot(btex série de entrada etex, .5[origin,f.w]);
label.top(btex $Y_t$ etex, .5[f.e,extr]);
label.bot(btex série de saída etex, .5[f.e,extr]);
endfig;
\end{mplibcode}
\end{document}