Graphs.jl to plot graphs in Jupyter notebooks?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Graphs.jl to plot graphs in Jupyter notebooks?

Angel de Vicente
Hi,

I'm trying to find a package that let's me create simple graphs easily
and visualize them. Graphs.jl looks fine for what I need, but I'm having
trouble to get the graphs plotted inside a Jupyter notebook. Perhaps I'm
missing something obvious, but by skimming through Graphs.jl's
documentation I didn't find anything.

(I have GraphViz installed and compiled with support for pangocairo, so
I have no trouble to create and plot in the notebook the following:

,----
| using GraphViz
| GraphViz.Graph("""
| graph graphname {
|      // The label attribute can be used to change the label of a node
|      a [label="Foo"];
|      // Here, the node shape is changed.
|      b [shape=box];
|      // These edges both have different line properties
|      a -- b -- c [color=blue];
|      b -- d [style=dotted];
|  }
| """)
`----

but when I do:

,----
| using Graphs
|
| g1a = simple_frucht_graph()
| plot(g1a)
`----

instead of plotting it in the notebook, a new window is opened.

Any pointers? Many thanks,
--
Ángel de Vicente
http://www.iac.es/galeria/angelv/         
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Graphs.jl to plot graphs in Jupyter notebooks?

David P. Sanders
Use LightGraphs.jl

I believe that Graphs.jl is deprecated.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Graphs.jl to plot graphs in Jupyter notebooks?

Tom Breloff
FYI... I'm working on a demo for this sort of thing... stay tuned:




On Fri, Nov 11, 2016 at 10:32 AM, David P. Sanders <[hidden email]> wrote:
Use LightGraphs.jl

I believe that Graphs.jl is deprecated.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Graphs.jl to plot graphs in Jupyter notebooks?

Angel de Vicente
In reply to this post by David P. Sanders
Hi,

"David P. Sanders" <[hidden email]> writes:
> Use LightGraphs.jl
>
> I believe that Graphs.jl is deprecated.

yes, thanks. I was aware that Graphs.jl was no going to be maintained
anymore, but somehow integration with visualization packages looked a
bit less convenient (I might be completely wrong, I just had a quick
look at LightGraphs page), so I wanted to try with Graphs first, but
LightGraphs is in my radar.

Cheers,
--
Ángel de Vicente
http://www.iac.es/galeria/angelv/         
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Graphs.jl to plot graphs in Jupyter notebooks?

Angel de Vicente
In reply to this post by Tom Breloff
Hi,

Tom Breloff <[hidden email]> writes:
> FYI... I'm working on a demo for this sort of thing... stay tuned:

looking forward to it. In the meantime I found a way to use Graphs to
nicely display the graphs inside Jupyter notebooks:

,----
| using Graphs
| using GraphViz
|
| g = simple_graph(3)  #Directed Graph (3 vertices, 0 edges)
| add_edge!(g, 1, 2)   #edge [1]: 1 -- 2
| add_edge!(g, 3, 2)   #edge [2]: 3 -- 2
| add_edge!(g, 3, 1)   #edge [3]: 3 -- 1
|
| GraphViz.Graph(Graphs.to_dot(g))
`----

Cheers,
--
Ángel de Vicente
http://www.iac.es/galeria/angelv/         
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Graphs.jl to plot graphs in Jupyter notebooks?

Tom Breloff

On Fri, Nov 11, 2016 at 11:32 AM, Angel de Vicente <[hidden email]> wrote:
Hi,

Tom Breloff <[hidden email]> writes:
> FYI... I'm working on a demo for this sort of thing... stay tuned:

looking forward to it. In the meantime I found a way to use Graphs to
nicely display the graphs inside Jupyter notebooks:

,----
| using Graphs
| using GraphViz
|
| g = simple_graph(3)  #Directed Graph (3 vertices, 0 edges)
| add_edge!(g, 1, 2)   #edge [1]: 1 -- 2
| add_edge!(g, 3, 2)   #edge [2]: 3 -- 2
| add_edge!(g, 3, 1)   #edge [3]: 3 -- 1
|
| GraphViz.Graph(Graphs.to_dot(g))
`----

Cheers,
--
Ángel de Vicente
http://www.iac.es/galeria/angelv/

Loading...