\documentclass[12pt,a4paper]{article}
\usepackage{tikz}
\usepackage{circuitikz}
\begin{document}
\begin{tikzpicture}
\node (a) at (0,0) [ocirc] {};
\node (c) at (1.5,0) [ocirc] {};
\node (b) at (3,0) [ocirc] {};
\node (d) at (1.5,2) [ocirc] {};
\node (e) at (1.5,-2)[ocirc] {};
\node[left] at (a) {$a$};
\node[left] at (c) {$c$};
\node[right] at (b) {$b$};
\node[above] at (d) {$1$};
\node[below] at (e) {$0$};
\path
(a) edge (d)
edge (e)
(b) edge (d)
edge (e)
(d) edge (c)
(c) edge (e);
\end{tikzpicture}
\end{document}
我如何控制杆子的尺寸a,b,c,1,0
?我想增加杆子的半径。
答案1
如手册中所述,杆的尺寸由键定义nodes width
,默认值为 0.04。此数字是某个“基本长度”的分数。例如,将其更改为\ctikzset{nodes width=0.2}
。
下面我使用标签而不是添加额外的节点,但这只是一个建议。
\documentclass[12pt,a4paper]{article}
\usepackage{circuitikz}
\ctikzset{nodes width=0.2} % default = 0.04
\begin{document}
\begin{tikzpicture}
\node (a) at (0,0) [ocirc, label=left:$a$] {};
\node (c) at (1.5,0) [ocirc, label=left:$c$] {};
\node (b) at (3,0) [ocirc, label=right:$b$] {};
\node (d) at (1.5,2) [ocirc, label=above:$d$] {};
\node (e) at (1.5,-2)[ocirc, label=below:$e$] {};
\path
(a) edge (d)
edge (e)
(b) edge (d)
edge (e)
(d) edge (c)
(c) edge (e);
\end{tikzpicture}
\end{document}
以下是如何将其应用于一个图表的几个示例:
\documentclass{article}
\usepackage{circuitikz}
\begin{document}
\begin{tikzpicture}
\node (a) at (0,0) [ocirc, label=left:$a$] {};
\end{tikzpicture}
\begin{tikzpicture}
\ctikzset{nodes width=0.2}
\node (a) at (0,0) [ocirc, label=left:$a$] {};
\end{tikzpicture}
\begin{tikzpicture}
\node (a) at (0,0) [ocirc, label=left:$a$] {};
\end{tikzpicture}
\begin{tikzpicture}[/tikz/circuitikz/nodes width=0.2]
\node (a) at (0,0) [ocirc, label=left:$a$] {};
\end{tikzpicture}
\begin{tikzpicture}
\node (a) at (0,0) [ocirc, label=left:$a$] {};
\end{tikzpicture}
\end{document}