JuliaAttic / OldGraphs.jl

Working with graphs in Julia
Other
205 stars 81 forks source link

plot function returns "nothing" #210

Open antoinemessager opened 8 years ago

antoinemessager commented 8 years ago

I am currently trying to plot graphs. I installed both GraphViz and Graph packages. I then try to follow the example given in the documentation (and written below). I first had to deal with the issue listed here https://github.com/JuliaLang/Graphs.jl/issues/172. Thus I changed the dot.jl file in order to use the png instead of the x11 format as explained here https://github.com/JuliaLang/Graphs.jl/issues/176. The error disappeared but now when I want to plot a graph the display function returns "nothing":

julia> using Graphs

julia> g = simple_graph(3)
Directed Graph (3 vertices, 0 edges)

julia> add_edge!(g, 1, 2)
edge [1]: 1 -- 2

julia> add_edge!(g, 3, 2)
edge [2]: 3 -- 2

julia> add_edge!(g, 3, 1)
edge [3]: 3 -- 1

julia> display(plot(g))
Nothing

Thank you for your help, Antoine

juliohm commented 8 years ago

@antoinemessager the plot(g) call should open a window with the visualization. If you are using Jupyter, consider the IJuliaPortrayals package.