答案1
答案2
另一种可能性是制作一个看起来像真正的 3-单纯形的图。
当然,您可以根据需要调整颜色、箭头、线条粗细、不透明度等。代码如下:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.markings}
\begin{document}
\begin{tikzpicture}[line join = round, line cap = round]
\coordinate [label=above:3] (3) at (0,{sqrt(2)},0);
\coordinate [label=left:2] (2) at ({-.5*sqrt(3)},0,-.5);
\coordinate [label=below:1] (1) at (0,0,1);
\coordinate [label=right:0] (0) at ({.5*sqrt(3)},0,-.5);
\begin{scope}[decoration={markings,mark=at position 0.5 with {\arrow{to}}}]
\draw[densely dotted,postaction={decorate}] (0)--(2);
\draw[fill=lightgray,fill opacity=.5] (1)--(0)--(3)--cycle;
\draw[fill=gray,fill opacity=.5] (2)--(1)--(3)--cycle;
\draw[postaction={decorate}] (1)--(0);
\draw[postaction={decorate}] (1)--(2);
\draw[postaction={decorate}] (2)--(3);
\draw[postaction={decorate}] (1)--(3);
\draw[postaction={decorate}] (0)--(3);
\end{scope}
\end{tikzpicture}
\end{document}
答案3
xy
解决方案。
\documentclass{report}
\usepackage[all]{xy}
\begin{document}
\[
\xymatrix{
& 3 \\
& 2 \ar[u] \\
1 \ar[rr] \ar[ru] \ar[ruu] && 0 \ar[lu] \ar[luu]
}
\]
\end{document}
答案4
使用纯 TikZ 的解决方案。外三角形是等边的。
\documentclass[tikz]{standalone}
\begin{document}
\begin{tikzpicture}
\path[->]
node (2) {2}
+(0, 1) node (3) {3}
+(-30:1) node (0) {0}
+(210:1) node (1) {1}
(1) edge (0)
(0) edge (2)
(0) edge (3)
(1) edge (2)
(1) edge (3)
(2) edge (3)
;
\end{tikzpicture}
\end{document}
使用不同的箭头,例如:
\documentclass[tikz]{standalone}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{tikzpicture}
\path[->, >={Computer Modern Rightarrow[length=3pt, width=3pt]}]
node (2) {2}
+(0, 1) node (3) {3}
+(-30:1) node (0) {0}
+(210:1) node (1) {1}
(1) edge (0)
(0) edge (2)
(0) edge (3)
(1) edge (2)
(1) edge (3)
(2) edge (3)
;
\end{tikzpicture}
\end{document}