我正在绘制示意图,我想指定组件端子的具体坐标。
例如,在我的绘图中(来源如下),我希望“X”点与 M4 的门处于同一高度。同样,我通过试验在 M6 的排水管下方绘制了点,但我希望自动将其调整为 M6 排水管的横坐标和 M7 门的纵坐标。
是否有命令可以提供组件终端的横坐标(或纵坐标)?
\documentclass[margin=10pt]{standalone}
\usepackage[siunitx]{circuitikz}
\begin{document}
\begin{tikzpicture}
\def\figHt{6};
\coordinate (ref_node1) at (2,0);
\coordinate (ref_node2) at (8,0);
\coordinate (ref_node3) at (12,0);
\coordinate (ref_nodeT1) at ($(ref_node1)+(0,\figHt)$);
\coordinate (ref_nodeT2) at ($(ref_node2)+(0,\figHt)$);
\coordinate (ref_nodeT3) at ($(ref_node3)+(0,\figHt)$);
\draw (ref_node1) node[nmos,anchor=source] (Mn0){}
(ref_node1) ++(-1,2) node[nmos, anchor=source] (M1){}
(ref_node1) ++(1,2) node[nmos, anchor=source, xscale=-1] (M2){}
(ref_node2) node[nmos,anchor=source] (Mn1){}
(ref_node2) ++(-1,2) node[nmos, anchor=source] (M3){}
(ref_node2) ++(1,2) node[nmos, anchor=source, xscale=-1] (M4){}
(ref_node3) node[nmos,anchor=source] (Mn2){}
(ref_nodeT1) ++(-1,0) node[pmos, anchor=source, xscale=-1] (M5){}
(ref_nodeT2) ++(-1,0) node[pmos, anchor=source] (M6){}
(ref_nodeT3) ++(0,-1)node[pmos, anchor=source] (M7){} ;
\draw (M1.drain)-- (M5.drain) node[circ] -| (M5.gate) node[circ] -- (M6.gate);
\draw (M2.drain) |- (M7.gate);
\draw (M7.gate) -- ++(-4.025,0)node[circ];
\draw (M3.drain) -- (M6.drain);
\draw (M7.drain) -- (Mn2.drain) |-(M4.gate);
\draw (Mn0.gate) -- (Mn1.gate)-- (Mn2.gate);
\draw (Mn0.drain) |- (M1.source)-- (M2.source);
\draw (Mn1.drain) |- (M3.source)-- (M4.source);
\draw (M1.drain) -- ++(0,0.25)-- ($(M4.drain)+(0,0.25)$)--(M4.drain);
\draw (Mn0.source) node[right]{$Mn_0$}
(Mn1.source) node[right]{$Mn_1$}
(Mn2.source) node[right]{$Mn_2$}
(M1.base) node[right]{$M_1$}
(M2.base) node[left] {$M_2$}
(M3.base) node[right] {$M_3$}
(M4.base) node[left]{$M_4$}
(M5.base) node[left]{$M_5$}
(M6.base) node[right]{$M_6$}
(M7.base) node[right]{$M_7$};
\draw (Mn0.source) node[ground]{};
\draw (Mn1.source) node[ground]{};
\draw (Mn2.source) node[ground]{};
\draw (M5.source) -- ++(5.5,0) node[anchor=south] {$V_{DD}$} -| (M7.source);
\draw (M1.gate) node[circ] node[left] {$Y_{2}$}
(M2.gate) node[circ] node[right]{$Y_{3}$}
(M3.gate) node[circ] node[left]{$Y_{1}$}
(M7.drain) node[circ] node[right]{$X$}
(Mn0.gate) node[circ] node[left]{$V_b$};
\end{tikzpicture}
\end{document}
答案1
您可以使用perpendicular intersection
(|-
,-|
)坐标系来放置节点。如果您想要和X
的交点M4.gate
,M7.drain
您可以使用:
\node[circ, label=right:$X$] at (M4.gate-|M7.drain) {};
从前面的命令可以看出,没有必要声明两个节点,一个用于circ
,一个用于label
,因为两者只需合并为一个即可。
您还可以使用相同的系统来放置元素:
\node[pmos, anchor=source] (M7) at (M4.gate-|M2.drain) {};
并阅读TiKZ
有关库的文档positioning
(3.0 版中的第 17.5.3 节)。