2
$\begingroup$

The graph I create is based on more then 1000 different word-combinations. A example looks like this:

text = {{word, word1}, {word1, word2}, {word1, word3}, {word,word4}, {word,word5}, {word,word6}, {word,word7}, {word,word8},....}

edgeList = Map[#[[1]] <-> #[[2]] &, text[[All, 1]]]

The output is like:

{word<-> word1, word <-> word2, word<-> word3, word<-> word4, word<-> word5, word<-> word6, word<-> word7, word <-> word8, word2 <-> word9, word3<-> word4,....}

I create a graph using:

Graph[edgeList, VertexLabels -> Placed["Name", Center], 
 VertexShapeFunction -> "Circle"]

Based on the real data, the graph ooks like: enter image description here

What we see is a high clustering of words which are difficult to read. I tried different options like GraphLayout -> "SpringElectricalEmbedding" without the desired output. Is there a option to create a graph where all the VertexLabels have a minimum distance to each other?

in respons to the comment of David G. Stork:

Graph[edgeList, VertexLabels -> Placed["Name", Center], 
 VertexShapeFunction -> "Circle", GraphLayout -> "SpiralEmbedding"]

enter image description here

$\endgroup$
  • $\begingroup$ Perhaps you may want to use Tooltips instead $\endgroup$ – Dr. belisarius Jul 2 '15 at 20:09
  • $\begingroup$ Thanks, but that is not a option if I want to export the graph as a gif $\endgroup$ – Michiel van Mens Jul 2 '15 at 20:14
  • $\begingroup$ Try GraphLayout -> "SpiralEmbedding". $\endgroup$ – David G. Stork Jul 2 '15 at 22:33
  • 1
    $\begingroup$ This is probably the one failing of Mathematica's graphs presentation so far (poor handling of labels). Otherwise it's really pretty. Hopefully they improve labeling in the future. A couple things I would try here: Increasing/decreasing the ImageSize of the graph, as the labels don't scale in proportion to it. Removing the vertices altogether to get a cleaner graph, also fading down the edges a bit. $\endgroup$ – amr Jul 3 '15 at 6:47
  • 1
    $\begingroup$ Mathematica is excellent when building and analyzing graphs. However, the rendering is sometimes better done in other systems, e.g. Gephi that has support for adjusting the presentation of labels. Exporting the graphs to Gephi is straightforward using Export. $\endgroup$ – FredrikD Jul 8 '15 at 7:02

Your Answer

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

Browse other questions tagged or ask your own question.