Plot function of igraph - (python)

Asked

Viewed 182 times

0

I tried to use the igraph library for python in order to plot a graph, I used the very example of the documentation, but it didn’t work.

Code used:

import igraph
from igraph import plot

g = igraph.Graph([(0,1), (0,2), (2,3), (3,4), (4,2), (2,5), (5,0), (6,3), (5,6)])
layout = g.layout("kk")
plot(g, layout=layout)

Errors returned:

line 455, in Plot result = Plot(target, Bbox, background=kwds.get("background", "white")) line 120, in init self. _surface_was_created = not isinstance(target, Cairo.Surface) line 396, in getattr raise Typeerror("plotting not available") Typeerror: plotting not available

1 answer

-3

For me what worked was a

pip install cairocffi

In any case, check to see if you have the libraries installed.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.