Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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:

A------------------------B
 \                      /
  C-----D              /
 / \     \            /
E---F     G          /
 \   \   / \        /
  \   H /   I      /
   \   /   /|     /
    \ /   / |    /
     J---K--L---M
    / \ /    \ / \
   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

2 Answers 2

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.

\documentclass[]{scrartcl}
\usepackage{fullpage}
\usepackage{tkz-graph}
\thispagestyle{empty}
\begin{document}

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

\begin{tikzpicture}[x=1.25cm,y=-2cm]
% 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}%
  {\Vertex[x=\xv,y=\yv,L=\Lv]{\v}}
% edges
\Edges(I,K,O,J,E,C,D,G,I,L,P,M,B,A,C,F,H) 
\Edges(N,J,K,L,M,Q) \Edges(G,J) \Edges(E,F)   

\end{tikzpicture}
\end{document}

enter image description here

share|improve this answer

Your Answer

 
discard

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.