Search code examples
graphdata-visualizationjuliagraph-visualization

Julia tool for graph visualization


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?


Solution

  • 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