Sunday, 2 June 2013

tikz center node below 2 other nodes

tikz center node below 2 other nodes

I want to create a node below 2 other node but place it exactly in the middle of the two nodes. Here's what I have so far...
     \documentclass[12pt]{article}
     \thispagestyle{empty}
     \usepackage{tikz}
     \usepackage{amsfonts}

     \begin{document}
     \begin{center}
     \begin{tikzpicture}[node distance=3cm]
      \node (top)          {$\top$};
      \node (node1)   [below left of=top]       {\{node1\}};
      \node (node2)      [left of=node1] {\{node2\}};
      \node (node3) [below right of=top] {\{node3\}};
      \node (node4)[right of=node3]         {\{node4\}};
      \node (node1node2) [below right of=node2]        {\{node2 , node1\}};
      \node (node4node3) [below right of=node3]        {\{node3, node4\}};
      \node (bot)   [below left of = node4node3]  {$\bot$};
      \draw (top)    -- (node1);
      \draw (top)    -- (node2);
      \draw (top)    -- (node3);
      \draw (top)    -- (node4);
      \draw (node4)    -- (node4node3);
      \draw (node3)    -- (node4node3);
      \draw (node2)    -- (node1node2);
      \draw (node1)    -- (node1node2);
      \draw (node1node2)    -- (bot);
      \draw (node4node3)    -- (bot);

     \end{tikzpicture}
     \end{center}
     \end{document}
The node "bot" is almost but not exactly in the middle of nodes "node1node2" and "node3node4". It should be at the bottom of the picture at the center

No comments:

Post a Comment