I have defined the following simple graph using the python's igraph package:
from igraph import *
g = Graph()
g.add_vertices(3)
g.add_edges([(1,0),(0,2),(1,2)])
plot(g)
According to the tutorial on igraph, the plot(g)
command must
"... open an external image viewer showing a visual representation of the network ... ".
However, the plot(g)
command gives an error while I execute the program, that is as follows.
Pavithrans-MacBook-Pro:LDPC pavithran$ python simplePlot.py
Traceback (most recent call last):
File "simplePlot.py", line 6, in <module>
plot(g)
File "/Library/Python/2.7/site-packages/igraph/drawing/__init__.py", line 458, in plot
result = Plot(target, bbox, background="white")
File "/Library/Python/2.7/site-packages/igraph/drawing/__init__.py", line 129, in __init__
self._surface_was_created = not isinstance(target, cairo.Surface)
File "/Library/Python/2.7/site-packages/igraph/drawing/utils.py", line 396, in __getattr__
raise TypeError("plotting not available")
TypeError: plotting not available
I am unable to understand where the error is and what exactly I must install in order to account for this error. I have installed Cairo’s Python bindings, XCode and (of course) the igraph package.
I will be very thankful if anyone can suggest me what I must do.