如何绘制如图所示的带有圆形和三角形的图形

如何绘制如图所示的带有圆形和三角形的图形

在此处输入图片描述

你好,请帮我用 latex tikz 画这幅图

答案1

\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{matrix,shapes.geometric,positioning}
\begin{document}
\begin{tikzpicture}[elli/.style={ellipse,minimum width=4em,minimum
height=2em,draw},trian/.style={regular polygon,regular polygon sides=3,
draw=brown,minimum width=5em},node distance=2em and
3em,arr/.style={-latex,thick}]
 \matrix[matrix of nodes,column sep=1em,row sep=2em,nodes={elli}] (mat)
 { & 8 & \\
  7 & & 11\\
  6 & 10 &9 \\
  };
 \node[above=of mat-1-2,trian,shape border rotate=180] (z0) {$z_0$};
 \node[right=of z0,trian,shape border rotate=180] (z1) {$z_1$};
 \node[below=of z1,elli] (12) {12};
 \node[below=of mat-3-1,trian] (x2) {$x_2$};
 \node[right=of x2,trian] (x0) {$x_0$};
 \node[right=4em of x0,trian] (x1) {$x_1$};
 \draw[arr,dotted] (x2) -- (mat-3-1);
 \draw[arr,dotted] (x2) to[bend left=50] (mat-2-1);
 \draw[arr,dotted] (x2) -- (mat-3-2);
 \draw[arr,dotted] (x0) -- (mat-3-2);
 \draw[arr,dotted] (mat-3-1) -- (mat-2-1);
 \draw[arr,dotted] (mat-2-1) -- (mat-1-2);
 \draw[arr,dotted] (mat-3-2) -- (mat-2-3);
 \draw[arr,dotted] (mat-3-3) -- (mat-2-3);
 \draw[arr,dotted] (mat-2-3) -- (12);
 \draw[arr] (x0) -- (mat-3-1);
 \draw[arr] (x2) -- (mat-3-3);
 \draw[arr] (x1.north) to[out=80,in=-70]  ([xshift=0.3em]mat-2-3.east) 
 to[out=110,in=-20] (mat-1-2);
 \draw[arr] (x1.80) to[bend right=25] (12);
 \draw[arr] (mat-1-2) -- (z0);
 \draw[arr] (12) -- (z1);
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容