我正在尝试绘制一个如下所示的简单框图:
schemabloc
似乎是要使用的包,但是话又说回来,它没有我需要的开关符号。circuitikz
似乎也不起作用。
我该如何使用tikz
或其他方法绘制该图表?
答案1
这是一个可能的解决方案,其中定义了几种样式以方便 tikz 绘图。
代码
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning,calc}
\usetikzlibrary{decorations.markings,shapes,arrows}
\begin{document}
\begin{tikzpicture}[->,auto,node distance=3cm,scale=1]
\tikzset{point/.style={coordinate},
block/.style ={draw, thick, rectangle, minimum height=4em, minimum width=6em},
line/.style ={draw, very thick,-},
}
\node[block] (a) []{Noice};
\node[block] (b) [below =2cm of a]{F0};
\node[block,yshift=1.6cm] (r) [right = 2 cm of b]{VT};
\draw[line] (r.west) -- ++(-0.5cm,0) coordinate(r1){};
\draw[line] (b.east) -- ++(1cm,0) -- ++(0,1cm) coordinate(b1){};
\draw[line] (a.east) -- ++(1cm,0) -- ++(0,-1cm)coordinate(a1){};
\draw[line,rounded corners=2pt] (b1) -- (r1);
\draw[very thick] ($(b1)+(-5pt,0)$) to [bend left ]($(a1)+(-5pt,0)$);
\draw[very thick,->=stealth] (r.east) -- ++(1cm,0) node[right](){Out};
\end{tikzpicture}
\end{document}
答案2
这是一个简单的版本元帖子。
单位是 PostScript 点:72 = 1 英寸,28.35=1 厘米。
prologues := 3;
outputtemplate := "%j%c.eps";
input boxes;
beginfig(1);
% define the boxes
boxit.n("Noise");
boxit.f("F0");
boxit.v("VT");
boxit.o("Out");
% place the centres of all the boxes, v.c = origin by implication
v.c + 20 up + 75 left = n.c;
v.c + 20 down + 75 left = f.c;
v.c + 50 right = o.c;
% define three points for the switch terminals
z1 = v.w + 10 left;
z2 = v.w + 20 left + 10 up;
z3 = v.w + 20 left + 10 down;
% make the boxes with borders all the same size
n.e-n.w = f.e-f.w = v.e-v.w = 34 right;
n.n-n.s = f.n-f.s = v.n-v.s = 21 up;
% draw the boxes, draw "Out" with no boundary
drawboxed(v,f,n); drawunboxed(o);
% draw the connections
draw n.e -- (x2,ypart n.e) -- z2;
draw f.e -- (x3,ypart f.e) -- z3 -- z1 -- v.w;
drawarrow v.e -- o.w;
% draw an arc to show the movement of the switch
ahlength := 2; % with a smaller arrowhead
drawarrow z3 { (z1-z3) rotated 90 } .. z2 { (z1-z2) rotated 90 }
cutbefore fullcircle scaled 4 shifted z3
cutafter fullcircle scaled 4 shifted z2
withcolor .5 white;
% put dots on the terminals
forsuffixes $=1,2,3: filldraw fullcircle scaled 2 shifted z$; endfor
endfig;
end.