Tuesday, 20 August 2013

Splitting circular nodes in tikz

Splitting circular nodes in tikz

I'm trying to reproduce the attached figure using the tikz package, but am
having a hard time splitting the node with the {X,x} in it. Any
suggestions?

Here's what I've come up with so far, but it's not good enough. The {X,x}
node needs to be rotated and split, exactly as in the figure (colors not
important):
\begin{tikzpicture}
\node [circle split,
draw,
line width = .05cm,
minimum width=1cm,
append after command={%
let \p1=($(\tikzlastnode.east)-(\tikzlastnode.west)$) in
node[draw,
shape=semicircle,
rotate=180,
anchor=south,
double,
minimum width=\x1] at (\tikzlastnode.center) {}}]
{$X$
\nodepart{lower}
$x$
};
\node [ellipse,draw,line width=.05cm] at (3.75,0) {$Y(x)$};
\node [circle,draw,line width=.05cm] at (1.5,3) {$L$};
\node [circle,draw,line width=.05cm] at (4,4.5) {$H$};
\draw[->, line width=.125cm] (1.1,0) -- (2.5,0);
\draw[->, line width=.125cm] (0.9,3) to [out=180,in=90] (-.5,1);
\draw[->, line width=.125cm] (1.8,2.6) -- (3,.75);
\draw[->, line width=.125cm] (3.45,4.2) -- (2.1,3.25);
\draw[->, line width=.125cm] (4,3.9) -- (4,.85);
%\draw[help lines] (0,0) grid (8,6) ;
\end{tikzpicture}

No comments:

Post a Comment