2

Here is the error I am getting when I am using plot. imort cairo doesn't give any errors which means the library which igraph uses to plot is installed still it shows up error. Can anyone help me in resolving this issue.

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-18-8ddaf3cef6bc> in <module>()
      1 layout = G.layout("kk")
----> 2 plot(G , layout = layout)

2 frames
/usr/local/lib/python3.6/dist-packages/igraph/drawing/__init__.py in plot(obj, target, bbox, *args, **kwds)
    444         bbox = BoundingBox(bbox)
    445 
--> 446     result = Plot(target, bbox, background=kwds.get("background", "white"))
    447 
    448     if "margin" in kwds:

/usr/local/lib/python3.6/dist-packages/igraph/drawing/__init__.py in __init__(self, target, bbox, palette, background)
    115         """
    116         self._filename = None
--> 117         self._surface_was_created = not isinstance(target, cairo.Surface)
    118         self._need_tmpfile = False
    119 

/usr/local/lib/python3.6/dist-packages/igraph/drawing/utils.py in __getattr__(self, _)
    394 
    395     def __getattr__(self, _):
--> 396         raise TypeError("plotting not available")
    397     def __call__(self, _):
    398         raise TypeError("plotting not available")


TypeError: plotting not available
  • Check this [accepted answer](https://stackoverflow.com/a/12078393/5081426) – Nauman Naeem Sep 24 '19 at 10:48
  • But I am using Google colab so that issue should not be there no? – Himank Kansal Sep 24 '19 at 10:50
  • Please share a self-contained notebook that reproduces the problem you observe. (I suspect the issue is that this library assumes the presence of an X11 server, which doesn't exist in a web browser, so you'll want to use a different plotting engine like matplotlib that understands the IPython environment.) – Bob Smith Sep 25 '19 at 13:32

0 Answers0