如何在 tikz 中绘制以下节点,请帮帮我。
答案1
首先是一些代码。它使用semicircle
根据您想要的符号完成的形状。
\documentclass[tikz,border=2mm]{standalone}
\usetikzlibrary{shapes,positioning}
\begin{document}
\tikzset{
mynode/.style={draw, semicircle, shape border rotate=90, minimum width=2cm,
append after command={
\pgfextra \draw (\tikzlastnode.chord center)--(\tikzlastnode.west); \endpgfextra}
}
}
\begin{tikzpicture}
\node[mynode, anchor=chord center, ] (a) at (0,0) {};
\draw ([yshift=-.5\pgflinewidth]a.arc end)--([xshift=1cm]a.chord center) coordinate (a-vertex)--([yshift=-.5\pgflinewidth]a.arc start);
\node[mynode, right=3cm of a-vertex] (b) {};
\draw ([yshift=-.5\pgflinewidth]b.arc start) arc[start angle=90, end angle=3, radius=1cm] --++(90:5mm);
\draw ([yshift=-.5\pgflinewidth]b.arc end) arc[start angle=-90, end angle=-3, radius=1cm] --++(-90:5mm);
\node[mynode, below right=2.5cm and 2.7cm of a-vertex] (c) {};
\draw ([yshift=-.5\pgflinewidth]c.arc start) arc[start angle=90, end angle=-90, radius=1cm];
\draw[-latex] (a-vertex)--node[above]{A} node[below]{0.3} (b.west);
\draw[-latex] (a-vertex)--node[above right]{B} node[below left]{0.7} (c.west);
\end{tikzpicture}
\end{document}