I am learning more about Tikz for drawing graphs. I am using the PGF3 stuff.

This layered graph is not laying out well. I want the graph to be symmetrical about the vertical axis, that passes though the top node.

By symmetrical I mean the positions of the nodes to be symmetrical. The edges can not be, and the text being symmetrical of-course makes no sense.



\begin{tikzpicture} [tree layout, 
            nodes={draw,circle, minimum width=30mm, align=center, inner sep=0.5em},
            innode/.style={draw=red, thick, dotted, inner sep=0em, scale=0.75},
            sibling distance=25mm, 
            level distance=25mm,

    \node(attack) {Shooting\\ Imminant}; 
    \node(shoot) {Ready to\\ to Shoot};
    \node(tense) {Ball Holder \\Tense};
    \node(fient) {Likely to Feint};
    \node(pass) {Teammate\\ Open\\for Pass};
    \node(rebound) {Teammate\\ Ready\\ to Catch\\ Rebound};
    \node(aiming) {Ball Holder\\Aiming};
    \node(goals) {Teammate\\ near goals};

    \node[innode](hand) {Hand Pos};
    \node[innode](head) {Head Facing};
    \node[innode](foot) {Foot Pos};
    \node[innode](team){ Team1 Positions};
    \node[innode](player){Ball Holder Pos};

        {(tense), (aiming)}->(shoot);
        {(rebound), (shoot),(fient)}->(attack);

        {(head),(hand),(foot)} -> {(tense)};
        {(hand),(head),(player)} -> (aiming);
        {(player),(team)} -> {(pass)};      
        {(team)} -> (goals);

  • Please complete your example in order to make it compilable! Thanks. And how shall we position the red circles? Their connections to the upper nodes can't be symmetrical. – LaRiFaRi Sep 19 '14 at 8:28
  • 2
    @LaRiFaRi: Fixed. I forgot I had the preamble in a separate file (QTikz does it that way). Also I clarified what i mean by symmetrical. The connections (edges) don't need to be. Only the node positions. – Lyndon White Sep 19 '14 at 12:15

Idea: §27.10 Using Several Different Layouts to Draw a Single Graph

\begin{tikzpicture}[sibling distance=25mm,level distance=25mm,thick,
    nodes={draw,circle,minimum width=30mm,align=center,inner sep=0.5em},
    innode/.style={draw=red,thick,dotted,inner sep=0em,scale=0.75}]
    \graph[layered layout]{
        //[tree layout]{
        //[tree layout]{
            rebound/Teammate\\Ready\\to Catch\\Rebound,
            shoot/Ready to\\to Shoot,
            fient/Likely to Feint};
        //[tree layout]{
            goals/Teammate\\near goals,
            aiming/Ball Holder\\Aiming,
            tense/Ball Holder\\Tense,
            pass/Teammate\\Open\\for Pass};
        //[tree layout]{
            head/Head Facing[innode],
            hand/Hand Pos[innode],
            team/Team1 Positions[innode],
            player/Ball Holder Pos[innode],
            foot/Foot Pos[innode]};

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.