4

I use julia programming language for my research. I do some graph processing. For this I use Graphs.jl library which suits me perfectly. But now I need a tool to visualize my graph.

I tried use:

plot(my_graph)

But it doesn't look so well. You can see it on a picture below.

enter image description here

Is there any other julia tool to visualize graph better?

Roman Dryndik
  • 1,167
  • 1
  • 13
  • 34

1 Answers1

3

Looks like Graphs.jl uses the Graphviz neato utility to plot the graphs.

You can "enhance" the graphs a bit by defining your own graph function.

julia> sg = simple_complete_graph(5)
Directed Graph (5 vertices, 20 edges)

julia> function my_plot(g::AbstractGraph, cmdline_opts::String="")
           if isempty(cmdline_opts) 
               stdin, proc = open(`neato -Tx11`, "w")
           else 
               stdin, proc = open(`neato -Tx11 $cmdline_opts`, "w")
           end
           to_dot(g, stdin)
           close(stdin)
       end
my_plot (generic function with 4 methods)

julia> my_plot(sg, "-Elen=3.0")

Imgur

rickhg12hs
  • 10,638
  • 6
  • 24
  • 42
  • @skan It would be much better if you asked a new question. Many more people will see it. – rickhg12hs Jul 12 '17 at 19:32
  • Most of my quesions are downvoted or closed because someone says it's not useful or it's supposed to be related to other questions. Anyway I've asked at julia forum. Thanks. – skan Jul 13 '17 at 11:10