title: Mathematica: How do I make a partial binary tree appear binary?
body: <p>In a recent <a href="https://stackoverflow.com/questions/6563407/classification-tree-implementation-in-mathematica/6563644#6563644">SO discussion</a> I displayed a binary classification tree that needed some pruning of vertices 6 and 7:</p>
  
  <p><img src="https://i.stack.imgur.com/mOciK.png" alt="needs pruning"></p>
  
  <p>Below is the code I used:</p>
  
  <pre><code>KaryTree[9, 2, 
   VertexLabels -&gt; {1 -&gt; "Blood pressure &gt; 91 ?", 2 -&gt; "Age &gt; 62.5?", 
     4 -&gt; "Sinus tachycardia ?", 8 -&gt; "&lt; 30 days"}, 
   EdgeLabels -&gt; {1 \[UndirectedEdge] 2 -&gt; "yes", 
     1 \[UndirectedEdge] 3 -&gt; "no", 2 \[UndirectedEdge] 4 -&gt; "yes", 
     2 \[UndirectedEdge] 5 -&gt; "no", 4 \[UndirectedEdge] 8 -&gt; "yes", 
     4 \[UndirectedEdge] 9 -&gt; "no"}, ImagePadding -&gt; 20]
  </code></pre>
  
  <p>If leaves 6 and 7 are pruned by <code>VertexDelete</code>, vertices 8 and 9 are also clipped:</p>
  
  <pre><code>VertexDelete[
     KaryTree[7, 2, 
       VertexLabels -&gt; {1 -&gt; "Blood pressure &gt; 91 ?", 2 -&gt; "Age &gt; 62.5?", 
                        4 -&gt; "Has sinus tachycardia ?"}, 
       EdgeLabels -&gt; {1 \[UndirectedEdge] 2 -&gt; "yes", 
                      1 \[UndirectedEdge] 3 -&gt; "no", 2 \[UndirectedEdge] 4 -&gt; "yes", 
                      2 \[UndirectedEdge] 5 -&gt; "no"}, ImagePadding -&gt; 20], {6, 7}]
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/2EXsD.png" alt="VertexDelete"></p>
  
  <p>TreeGraph is willing to plot the graph, but it has its own mind about how the graph should be laid out:</p>
  
  <pre><code>TreeGraph[{1 \[UndirectedEdge] 2, 1 \[UndirectedEdge] 3, 
             2 \[UndirectedEdge] 4, 2 \[UndirectedEdge] 5, 4 \[UndirectedEdge] 6,
             4 \[UndirectedEdge] 7}, 
     VertexLabels -&gt; {1 -&gt; "Blood pressure &gt; 91 ?", 2 -&gt; "Age &gt; 62.5?", 
                      4 -&gt; "Has sinus tachycardia ?", 6 -&gt; "&lt; 30 days"}, 
     EdgeLabels -&gt; {1 \[UndirectedEdge] 2 -&gt; "yes", 
                    1 \[UndirectedEdge] 3 -&gt; "no", 2 \[UndirectedEdge] 4 -&gt; "yes", 
                    2 \[UndirectedEdge] 5 -&gt; "no", 4 \[UndirectedEdge] 6 -&gt; "yes", 
                    4 \[UndirectedEdge] 7 -&gt; "no"}, ImagePadding -&gt; 20]
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/pYzMs.png" alt="TreeGraph"></p>
  
  <p>I'd like vertex 1 to be displayed at the top as the root of the graph.</p>
  
  <p>I've played around with various <code>GraphLayout</code> settings but not found a solution.  Any ideas?</p>