Questions tagged [trees]

{trees} is for questions about drawing or constructing tree {diagrams} (for example, family trees).

Filter by
Sorted by
Tagged with
8
votes
3answers
5k views

tikz trees: How to not draw a single edge

I want to draw a tree and not draw specific edges. I try it like this \documentclass[preview]{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture}[every node/.style={circle,draw}] ...
8
votes
5answers
800 views

Tree, then arrow, then tree

I'm trying to show a transition between two trees. Right now I'm using minipages, but the spacing is all off: The trees should be closer, and ideally the arrow should be longer. Finally, for extra ...
8
votes
2answers
1k views

how to draw a diagram that forks out, then joins in the middle then forks out again?

Update: ref comments: I've slightly corrected the terminology and the title. I am using the term diagram now, instead of tree, and I am just asking on how to draw this diagram in Tikz. Any tool or ...
8
votes
1answer
3k views

How to draw a joining line between two picture tikz-pgf

I'am having draw two tree using the tikz-pgf package \begin{frame} \begin{columns}[c] \begin{column}{2cm} \begin{tikzpicture}[scale=0.5] \tikzstyle{level 1}=[sibling distance=10mm] ...
8
votes
4answers
4k views

TikZ - game tree representation with continuum of moves

I have been using TikZ to draw game-trees for my game-theory lectures (mostly using the automata package) but I could not figure out how to draw an arc across the edges the leave a given node. When we ...
8
votes
3answers
2k views

tree list in a table

I would like to put a tree list into a table environment. Smth. like: +--------------------------+---------------------------+-------------+ | Heading 1 | Heading 2 | ...
8
votes
3answers
1k views

pstree: How can I force a tree node to one side?

I'm drawing some binary search trees using pstricks and pstree, but I don't see anything in the docs to push a node to one side. In a binary search tree, every child must be either right or left, but ...
8
votes
2answers
6k views

How to draw empty nodes in tikz-qtree?

I'm new to tikz-qtree, and I would like to reproduce this figure in LaTeX: So far, I've managed to cobble this bit of code, but the results are a bit comical, as the empty nodes (those without text) ...
8
votes
2answers
3k views

TikZ: Draw a B+ Tree

Having consulted How do I draw a B+ tree with tikz in latex with more than 4 Key value pair in a node and How do I draw a B+ tree in latex? threads, I think the multipart feature of TikZ might just do ...
8
votes
2answers
388 views

Maps between rooted trees using forest (and TiKz)

I had to draw rooted (upward oriented) trees (with leaves). I found the package forest useful, although most likely the work-arounds I employed are not really optimal in any proper sense. An example ...
8
votes
1answer
926 views

Understanding forest options when customising trees

This is a follow-up to Gonzalo Medina's answer to this question. The solution offered there includes the following code at the start of the forest environment: edge path={ \noexpand\path[\...
8
votes
2answers
233 views

Seeking improvement on a poor solution---for descendant charts

I've a solution to a problem that screams out for improvement. I'm working on a second edition of a family history (mine) that has a great number of descendant charts. I've cobbled together a way of ...
8
votes
1answer
1k views

beamer and forest

I am preparing beamer presentation and flow chart using forest. For some reason, it is suggesting extra } or problem with \end{frame}. Here is the code: \documentclass[12pt,a4paper]{beamer} \...
7
votes
2answers
9k views

How to draw a horizontal tree with branches on the right and left?

I need to draw trees but they should extend (from the root) on both sides. TikZ seems a good solution but do not how to manage it.
7
votes
1answer
2k views

Creating Tic-Tac-Toe boards with LaTeX/TikZ

I am trying to create a diagram of tic-tac-toe boards similar to the one attached below. I cannot seem to find any documentation or examples on how to create these boards in LaTeX or TikZ. Does ...
7
votes
2answers
1k views

Trees with only leaves in TikZ

Following Roel's answer to How to write a tree with no (visible) root with TikZ? I attempted to visualise my Huffman-Code for "Tennessee", but it didn't turn out as I expected: My MWE: \...
7
votes
1answer
385 views

Multiway trees like in Knuth's The Art of Computer Programming, Volume 3

I was wondering if anybody knows how to draw a multiway tree like in Knuth's The Art of Computer Programming, Volume 3 on page 484? This looks like a rounded box with the value of the keys being ...
7
votes
1answer
304 views

Table of content as right side growing tree

How to prepare table of contents as follows: \documentclass{article} \usepackage{tikz} \usepackage{tikz-qtree} \begin{document} \begin{tikzpicture} \tikzset{grow'=right,level distance=32pt} \...
7
votes
2answers
5k views

How to colour branch/edge on a tree using tikz?

I have created a tree diagram using tikz on Latex. However I'm not sure how to go about highlighting/adding colour to a branch. For instance, looking at the tree that I've illustrated, I want to ...
7
votes
2answers
219 views

Radial node arrangement in Forest

I have a number of 'decision tree' type of charts I am trying to produce dynamically (rather than in Illustrator or OmniGraffle). Each chart contains a few hundred nodes. Because of the number of ...
7
votes
2answers
577 views

nice empty nodes broken by forest 2.0?

I've been using the "nice empty nodes" style from the forest manual for trees for quite a while now. Today I updated the package, and now it throws an error (though the output still seems to work). ...
7
votes
2answers
155 views

Decision tree nodes overlapping with Tikz

Does anyone know how to prevent the branches of a decision tree from converging on each other? This is with Tikz - I've tried tweaking the sibling distance and things like that, but two of the ...
7
votes
1answer
884 views

Creating radial trees in TikZ

I am fairly new TikZ user and I am looking for a way to generate a radial tree similar this: or this: So far, I have two methods of doing this: 1) Program it manually - This involves quite a lot ...
7
votes
1answer
7k views

LaTeX probability tree

Please could you tell me if the Probability tree posted on 2006-12-14 by Kjell Magne Fauske can be done with three branches instead of just two.
7
votes
1answer
1k views

Incomplete arrows and missing arrow heads in TikZ

I have the following plot which looks good, but there are two issues: Not all arrows have arrow-heads. I have no idea why this is. Some edges are not long enough. For example, the left edge of the ...
7
votes
1answer
2k views

Trees in latex : Depth of 4 nodes

I am following the current tutorial (MWE) : link However, I am facing difficulties to perform a tree of 4 nodes. Items are superposed, and even if I add a child [missing] {} it doesn't solve the ...
6
votes
2answers
446 views

Special tree in tikz

I'm trying to draw a tree like this: The root has three children and every of this two... The nodes in the first two tiers has additional informations.. I searched for examples like that, but could ...
6
votes
3answers
1k views

Draw lines on top of tikz forest

I am trying to illustrate DFS with tikz like http://www.cse.unsw.edu.au/~billw/Justsearch1.gif does. I have come up with \documentclass[border=10pt]{standalone} \usepackage{forest} \begin{document}...
6
votes
1answer
1k views

How to create syntactic trees and align them in LaTeX?

I want to create syntactic trees and align them in LaTeX as in the picture below. Can you help me?
6
votes
2answers
3k views

TikZ-tree: edge-alignment in horizontal org-chart

I'm working on some sort of org-chart/hierarchy-tree and ran into issues with the edge-alignment. As a guideline I used the family-tree-TeXample. See the TeX.sx-dicussion here. However, the text in ...
6
votes
2answers
1k views

Adding Triangles to LaTeX Decision Trees

I am using the 'forest' package in LaTeX in order to create decision trees with multiple decisions. I've got it mostly how I want it, except for two things: I'd like the circles at the leaves of the ...
6
votes
2answers
603 views

Saving vertical space in tree diagram

I have many nodes on one tier. Thus I use the grow east option already. But this is not enough... I would like to save a bit more vertical space for instance through pulling two of the branches a ...
6
votes
2answers
527 views

Automatic connection of text points in tikz-qtree

I have to draw pictures like the following a lot: I want to use tikz-qtree, since I have a lot of trees and this package simplifies things considerably. Right now I use the following code, since it ...
6
votes
2answers
3k views

Unbalanced binary tree with forest

How can one draw an unbalanced binary tree - with missing nodes using the forest package?
6
votes
2answers
5k views

Recursion Tree in LaTeX

How can the following recursion tree be drawn in LaTeX? I have tried using TikZ pictures for this, but I continue to get errors in the code. Please suggest an easier code for the same.
6
votes
2answers
1k views

How can I draw a circle around an entire tree in forest?

For some reason that I cannot discern, using tikz={\node [draw,circle,fit to tree]{};} to draw a circle around nodes in a tree works as expected if the nodes are embedded in a larger tree. However, ...
6
votes
3answers
14k views

Draw a binary tree using tikz

I'm trying to draw a binary tree using tikz package. If I use only circle, I get a tree. But I want to represent a subtree using a triangle. Now the tree gets uneven. I want to attach the arrows to ...
6
votes
2answers
1k views

How do I draw merged red black tree into 2,3,4 tree in tikz?

I'm using tikz in study material and I want to show analogy between RB trees and B-trees (2,3,4 tree). I want my output looks something like this example from Wikipedia. For RB tree I'm using almost ...
6
votes
2answers
7k views

Tools for tree diagram

I would like to make a simple scheme looking like tree diagram (structure like this or that). The problem is that all the packages I did try, could make nice binary trees with little information in ...
6
votes
1answer
4k views

Horizontal Probability Tree with Level Labels

I'm trying to create a Horizontal Probability Tree with Level Labels using tikz. (Not tikz-qtree). Right now, I have a horizontal tree. The labels are NOT aligned to the top of the diagram. I would ...
6
votes
2answers
223 views

Tight fit in horizontal diagram generated with forest

I use the forest package to create a diagram similar to the one below. Is there any chance to reduce the distance between B5 and B6? I would prefer, if B6 and its subtree could be moved up. I have ...
6
votes
1answer
4k views

How to make Directory List in LaTeX?

I am writing an article using LaTeX. It is a research report about developing mathematics ebook using LaTeX. It contains directory list consists of folders and files, like this: - [folder_icon][...
6
votes
1answer
753 views

How do I draw curve crossing one edge of a tree (using tikz-qtree)?

I am using tikz-qtree, and I'd like to draw a curve separating a set of nodes from the rest of the tree. For example, \documentclass{article} \usepackage{tikz} \usepackage{tikz-qtree} \begin{...
6
votes
1answer
131 views

Trees in context

Excuse me for my english, is not my language. I have a document in LaTeX, the relevant code is \documentclass[a4 paper, 12pt]{article} \usepackage{tikz-qtree} \usepackage{tikz} \usepackage{pgf} \...
6
votes
1answer
641 views

How to add curly brace below xytree nodes

I would like to add a curly brace and label underneath the E and F nodes of an xytree like this: So far, I have the code for the tree, but haven't been able to figure out how to insert the curly ...
6
votes
1answer
523 views

Dependency trees with crossings and dotted lines

For a presentation I need to refer to a paper which uses a certain kind of dependency tree: Since I wanted to build some examples on my own, I'd be glad to rebuild this. I've tried several linguistic ...
6
votes
1answer
1k views

Draw randomized tree in TikZ

I am trying to draw a randomized tree using TikZ, that is, I'm looking for a macro \randtree{NN}{x} that attaches a randomized tree of maximum depth x to a node named NN. The nodes need not be visible ...
6
votes
1answer
1k views

Customized edge in forest tree

Following the examples in the documentation, it is not too difficult to customize the edge of trees using the tikz-qtree package. The following code illustrates it: \documentclass{standalone} \...
6
votes
1answer
919 views

How to fix the overlapped nodes with long text, in TikZ. Concept maps

I'd like to get helping from you. I want to have paragraphs in the nodes of the concept map with Tikz, I mean, texts with multiple lines. I have a problem with texts, the nodes are overlapped. Here's ...
6
votes
1answer
364 views

What is a suitable package for drawing term algebra style trees

I want to be able to draw something like nested triangles that are arranged in a tree-like fashion. Or explicitly, a node of a tree is represented as an isosceles triangle pointed upward. Each ...