答案1
和tikz-cd
:
\documentclass[border=3.141592]{standalone}
\usepackage{tikz-cd}
\usetikzlibrary{arrows.meta,
bending}
\begin{document}
\begin{tikzcd}[sep=huge,
cells={nodes={circle, draw=gray,
minimum size=4.4em, inner sep=1pt, font=\small}},
every arrow/.append style = {-Latex, semithick}
]
\mathrm{Facebook}
\ar[out=210, in=150, looseness=5, "0.4"]
\ar[r,bend left,"0.3"]
\ar[dr,"0.3" ']
& \mathrm{YouTube}
\ar[out=30,in=330,looseness=5,"0.6"]
\ar[l,bend left,"0.2"]
\ar[d,"0.3"] \\
\mathrm{Instagram}
\ar[out=210,in=150,looseness=5,"0.5"]
\ar[r,"0.4"]
& \mathrm{Work}
\ar[out=30,in=330,looseness=5,"1"]
\end{tikzcd}
\end{document}
答案2
看起来该图形已经在 TikZ 中绘制好了。尝试[bend left=50]
调整边缘的曲率和角度(默认[bend left]
意味着[bend left=30]
)。
\documentclass[tikz,border=5mm]{standalone}
\begin{document}
\begin{tikzpicture}
\def\a{3.5}
% \path[nodes={circle,draw,fill=yellow!50,minimum size=18mm}]
\path[nodes={circle,draw}]
(0,0) node (I) {Instagram}
(\a,0) node (W) {Work}
(0,\a) node (F) {Facebook}
(\a,\a) node (Y) {YouTube}
;
\begin{scope}[-latex]
\draw (I) to node[above]{$0.4$} (W);
\draw (F) to node[below left]{$0.3$} (W);
\draw (Y) to node[right]{$0.2$} (W);
\draw (Y) to[loop right] node{$0.6$} ();
\draw (W) to[loop right] node{$1$} ();
\draw (I) to[loop left] node{$0.6$} ();
\draw (F) to[loop left] node{$0.4$} ();
% try [bend left=50]. Default [bend left] means [bend left=30]
\draw (F) to[bend left] node[above]{$0.3$} (Y);
\draw (Y) to[bend left] node[above]{$0.2$} (F);
\end{scope}
\end{tikzpicture}
\end{document}
如果你希望 Facebook、Youtube、Instagram 和 Work 有相同的尺寸,只需使用
\path[nodes={circle,draw,fill=yellow!50,minimum size=18mm}]