TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to generate a diagram showing relationships between points. I can convert my data into a simple syntax, such as this below (other forms of syntax is okay too):

A (B, C) % A is connected to B and C
C (A, D, E, F) % C is connected to A, D, E, and F

The resulting information should be converted into some kind of diagram, such as this:

 \                      /
  C-----D              /
 / \     \            /
E---F     G          /
 \   \   / \        /
  \   H /   I      /
   \   /   /|     /
    \ /   / |    /
    / \ /    \ / \
   N   O      P   Q
  • The points will contain words, e.g.

    "ocean" ("current", "tidal wave")

  • These points should never be placed on top of other points, otherwise, it would be difficult to read them.

  • There are no arrows at the ends of the lines.
  • There are no labels at the mid-points of the lines.

Are there any tools which can generate such a diagram?

share|improve this question
up vote 5 down vote accepted

Have a look at graphviz and dot2tex. The dot program in the graphviz suite should let you define the relationships and dot2tex should convert it to Tikz for you. You can turn the TikZ into pdf with LaTeX.

I haven't used dot2tex but I have used dot: it's easy to use.

share|improve this answer

I enter the coordinates line after line, I think it's not too difficult. If some words are too long, you can modify the value of x.


% style
\tikzset{VertexStyle/.style = {draw, shape=rectangle}}
\tikzset{EdgeStyle/.style   = {dashed,color  = orange}}  

% vertex
\foreach \xv/\yv/\v/\Lv in {%
 0/0/A/Word 1, 10/0/B/Word 2,
 1/1/C/Word 3, 5/1/D/Word 4,
 0/2/E/Word 5, 2/2/F/Word 6, 6/2/G/Word 7,
 3/3/H/Word 8, 7/3/I/Word 9,
 2/5/J/Word 10, 4/5/K/Word 11, 6/5/L/Word 12, 8/5/M/Word 13,
 1/6/N/Word 14, 3/6/O/Word 15, 7/6/P/Word 16, 9/6/Q/Word 17}%
% edges
\Edges(N,J,K,L,M,Q) \Edges(G,J) \Edges(E,F)   


enter image description here

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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