tikz-network
我尝试使用和包 生成图中所示的图形,tikz
但无法获得T
如图所示的形状的半边。任何帮助都值得感激。
\begin{tikzpicture}[node distance = {20mm},thick, main/.style = {draw,circle}]
\node[main] (1) {$x_1$};
\node[main] (2) [right of = 1]{$x_2$};
\node[main] (3) [below right of= 2]{$x_3$};
\node[main] (4) [below left of= 3]{$x_4$};
\node[main] (5) [left of=4 ]{$x_5$};
\node[main] (6) [below left of=1]{$x_6$};
\draw (2) -- (4);
\draw[->] (1) -- (2);
\draw[->] (1) to [out=135, in=90, looseness=1.5] (3);
\draw (6) --+(30:1cm);
\draw (6) --+(0:1cm);
\draw (6) --+(-30:1cm);
答案1
只是为了好玩:)。使用极坐标和 tikz arrow.meta
:
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\tikzset{
cnd/.style={
draw,circle,minimum size=0.75cm,
},
}
\begin{document}
\begin{tikzpicture}
\foreach \ang [count=\n from 1] in {90,30,...,-210}
\node (v\n) [cnd] at (\ang:1.5cm) {$v_\n$};
\draw (v1.-120) to[bend right] (v4.120);
\draw (v1.-90) to[bend right] (v3.135);
\draw [-Bar] (v1.-45) -- +(-45:0.3);
\draw [-Bar] (v2.-180) -- +(180:0.3);
\draw [-Bar] (v2.-135) -- +(-135:0.3);
\draw [-Bar] (v4.100) -- +(100:0.3);
\draw [-Bar] (v4.80) -- +(80:0.3);
\draw [-Bar] (v4.60) -- +(60:0.3);
\draw [-Bar] (v5.45) -- +(45:0.3);
\draw [-Bar] (v5.0) -- +(0:0.3);
\draw [-Bar] (v6.0) -- +(0:0.3);
\draw [-Bar] (v6.-45) -- +(-45:0.3);
\begin{scope}[xshift=4cm]
\foreach \ang [count=\n from 1] in {90,30,...,-210}
\node (v\n) [cnd] at (\ang:1.5cm) {$v_\n$};
\draw (v1.-120) to[bend right] (v4.120);
\draw (v1.-90) to[bend right] (v3.135);
\draw (v1.-45) to[out=-45,in=0] (v6.0);
\draw [-Bar] (v2.-180) -- +(180:0.3);
\draw [-Bar] (v2.-135) -- +(-135:0.3);
\draw [-Bar] (v4.100) -- +(100:0.3);
\draw [-Bar] (v4.80) -- +(80:0.3);
\draw [-Bar] (v4.60) -- +(60:0.3);
\draw [-Bar] (v5.45) -- +(45:0.3);
\draw [-Bar] (v5.0) -- +(0:0.3);
\draw [-Bar] (v6.-45) -- +(-45:0.3);
\end{scope}
\end{tikzpicture}
\end{document}