答案1
我不知道是否有一个包可以帮助绘制这个图表,但直接用 tikz 来做并不难。你只需要很多\foreach
命令来避免重复代码。
这可能是一个起点:
\documentclass[border=2mm]{standalone}
\usepackage {tikz}
\usetikzlibrary{3d} % for 'canvas is ...' option in the scope
\usetikzlibrary{calc} % calculates coordinates
\begin{document}
\begin{tikzpicture}[z={(0.5cm,0.5cm)}]
% dimensions
\def\l{4} % cube edges lenght
\def\r{1} % circles radii
\def\d{0.05} % dots radii
% coordinates and circles
\foreach\y in {1,2} \foreach\i in {1,...,4}
{%
\begin{scope}[canvas is xz plane at y=\y*\l,rotate=90*\i-45]
\coordinate (\y-\i-0) at ({0.5*sqrt(2)*\l},0);
\foreach\j in {1,2,3}
{%
\coordinate(\y-\i-\j) at ($(\y-\i-0)+(135*\j-270:\r)$);
%\node[above] at (\y-\i-\j) {\small\y-\i-\j}; % <-- uncomment to see the
} % coordinates names
\draw (\y-\i-0) circle (\r);
\end{scope}
}
% lines
\foreach\i in {1,...,4}
{% vertical lines:
\draw[fill] (1-\i-2) circle (\d) -- (2-\i-2) circle (\d);
\foreach\j in {1,2}
{% horizontal lines:
\pgfmathtruncatemacro\ii{Mod(\i,4)+1}
\draw[fill] (\j-\i-3) circle (\d) -- (\j-\ii-1) circle (\d);
}
}
\end{tikzpicture}
\end{document}