I have python 3.8.13, igraph 0.10.1, with matplotlib 3.6.0, and when running the sample scripts from the install page on the website, I am receiving an error. The scripts can be found here: https://igraph.org/python/tutorial/latest/install.html
I am referring to the following
import matplotlib.pyplot as plt import igraph as ig fig, ax = plt.subplots() g = ig.Graph.Famous("petersen") ig.plot(g, target=ax) plt.show()
I receive the following errors at the ig.plot(g, target=ax) line:
--------------------------------------------------------------------------- AttributeError Traceback (most recent call last) Cell In [120], line 6 4 fig, ax = plt.subplots() 5 g = ig.Graph.Famous("petersen") ----> 6 ig.plot(g, target=ax) 8 plt.show()
File ~/anaconda3/envs/rapids-2208/lib/python3.8/site-packages/igraph/drawing/__init__.py:245, in plot(obj, target, bbox, *args, **kwds) 243 return 244 else: --> 245 plotter( 246 backend, 247 target, 248 palette=palette, 249 *args, 250 **kwds, 251 ) 252 return target 254 # Cairo backend
File ~/anaconda3/envs/rapids-2208/lib/python3.8/site-packages/igraph/drawing/graph.py:558, in __plot__(self, backend, context, *args, **kwds) 552 from igraph.drawing import DrawerDirectory 554 drawer = kwds.pop( 555 "drawer_factory", 556 DrawerDirectory.resolve(self, backend)(context), 557 ) --> 558 drawer.draw(self, *args, **kwds)
File ~/anaconda3/envs/rapids-2208/lib/python3.8/site-packages/igraph/drawing/matplotlib/graph.py:233, in MatplotlibGraphDrawer.draw(self, graph, *args, **kwds) 231 drawer_method = vertex_drawer.draw 232 for vertex, visual_vertex, coords in vertex_coord_iter: --> 233 drawer_method(visual_vertex, vertex, coords) 235 # Construct the iterator that we will use to draw the vertex labels 236 vs = graph.vs
File ~/anaconda3/envs/rapids-2208/lib/python3.8/site-packages/igraph/drawing/matplotlib/vertex.py:60, in MatplotlibVertexDrawer.draw(self, visual_vertex, vertex, coords) 49 width = ( 50 visual_vertex.width 51 if visual_vertex.width is not None 52 else visual_vertex.size 53 ) 54 height = ( 55 visual_vertex.height 56 if visual_vertex.height is not None 57 else visual_vertex.size 58 ) ---> 60 stroke = visual_vertex.shape.draw_path( 61 ax, 62 coords[0], 63 coords[1], 64 width, 65 height, 66 facecolor=visual_vertex.color, 67 edgecolor=visual_vertex.frame_color, 68 linewidth=visual_vertex.frame_width, 69 zorder=visual_vertex.zorder, 70 ) 71 ax.add_patch(stroke)
File ~/anaconda3/envs/rapids-2208/lib/python3.8/site-packages/igraph/drawing/shapes.py:168, in CircleDrawer.draw_path(ctx, center_x, center_y, width, height, **kwargs) 166 return mpl.patches.Circle((center_x, center_y), width / 2, **kwargs) 167 else: --> 168 ctx.arc(center_x, center_y, width / 2, 0, 2 * pi)
AttributeError: 'AxesSubplot' object has no attribute 'arc'
---------------------------------------------
Not sure if its my python or package versions, or if its a configuration issue, or possibly an issue with igraph or matplotlib. Any advice would be most welcome
Hi,
I can't believe I have to explain this, but this is the mailing list for graph-tool, not for igraph.
Please refer to the igraph mailing list for help.
Best, Tiago
Am 21.09.22 um 12:21 schrieb Jos J:
I have python 3.8.13, igraph 0.10.1, with matplotlib 3.6.0, and when running the sample scripts from the install page on the website, I am receiving an error. The scripts can be found here: https://igraph.org/python/tutorial/latest/install.html https://igraph.org/python/tutorial/latest/install.html
I am referring to the following
import matplotlib.pyplot as plt import igraph as ig fig, ax = plt.subplots() g = ig.Graph.Famous("petersen") ig.plot(g, target=ax) plt.show()
I receive the following errors at the ig.plot(g, target=ax) line:
AttributeError Traceback (most recent call last) Cell In [120], line 6 4 fig, ax = plt.subplots() 5 g = ig.Graph.Famous("petersen") ----> 6 ig.plot(g, target=ax) 8 plt.show()
File ~/anaconda3/envs/rapids-2208/lib/python3.8/site-packages/igraph/drawing/__init__.py:245, in plot(obj, target, bbox, *args, **kwds) 243 return 244 else: --> 245 plotter( 246 backend, 247 target, 248 palette=palette, 249 *args, 250 **kwds, 251 ) 252 return target 254 # Cairo backend
File ~/anaconda3/envs/rapids-2208/lib/python3.8/site-packages/igraph/drawing/graph.py:558, in __plot__(self, backend, context, *args, **kwds) 552 from igraph.drawing import DrawerDirectory 554 drawer = kwds.pop( 555 "drawer_factory", 556 DrawerDirectory.resolve(self, backend)(context), 557 ) --> 558 drawer.draw(self, *args, **kwds)
File ~/anaconda3/envs/rapids-2208/lib/python3.8/site-packages/igraph/drawing/matplotlib/graph.py:233, in MatplotlibGraphDrawer.draw(self, graph, *args, **kwds) 231 drawer_method = vertex_drawer.draw 232 for vertex, visual_vertex, coords in vertex_coord_iter: --> 233 drawer_method(visual_vertex, vertex, coords) 235 # Construct the iterator that we will use to draw the vertex labels 236 vs = graph.vs
File ~/anaconda3/envs/rapids-2208/lib/python3.8/site-packages/igraph/drawing/matplotlib/vertex.py:60, in MatplotlibVertexDrawer.draw(self, visual_vertex, vertex, coords) 49 width = ( 50 visual_vertex.width 51 if visual_vertex.width is not None 52 else visual_vertex.size 53 ) 54 height = ( 55 visual_vertex.height 56 if visual_vertex.height is not None 57 else visual_vertex.size 58 ) ---> 60 stroke = visual_vertex.shape.draw_path( 61 ax, 62 coords[0], 63 coords[1], 64 width, 65 height, 66 facecolor=visual_vertex.color, 67 edgecolor=visual_vertex.frame_color, 68 linewidth=visual_vertex.frame_width, 69 zorder=visual_vertex.zorder, 70 ) 71 ax.add_patch(stroke)
File ~/anaconda3/envs/rapids-2208/lib/python3.8/site-packages/igraph/drawing/shapes.py:168, in CircleDrawer.draw_path(ctx, center_x, center_y, width, height, **kwargs) 166 return mpl.patches.Circle((center_x, center_y), width / 2, **kwargs) 167 else: --> 168 ctx.arc(center_x, center_y, width / 2, 0, 2 * pi)
AttributeError: 'AxesSubplot' object has no attribute 'arc'
Not sure if its my python or package versions, or if its a configuration issue, or possibly an issue with igraph or matplotlib. Any advice would be most welcome
graph-tool mailing list -- graph-tool@skewed.de To unsubscribe send an email to graph-tool-leave@skewed.de
My sincerest apologies
On Wed, Sep 21, 2022 at 3:52 AM Tiago de Paula Peixoto tiago@skewed.de wrote:
Hi,
I can't believe I have to explain this, but this is the mailing list for graph-tool, not for igraph.
Please refer to the igraph mailing list for help.
Best, Tiago
Am 21.09.22 um 12:21 schrieb Jos J:
I have python 3.8.13, igraph 0.10.1, with matplotlib 3.6.0, and when running the sample scripts from the install page on the website, I am receiving an error. The scripts can be found here: https://igraph.org/python/tutorial/latest/install.html https://igraph.org/python/tutorial/latest/install.html
I am referring to the following
import matplotlib.pyplot as plt import igraph as ig fig, ax = plt.subplots() g = ig.Graph.Famous("petersen") ig.plot(g, target=ax) plt.show()
I receive the following errors at the ig.plot(g, target=ax) line:
AttributeError Traceback (most recent call
last)
Cell In [120], line 6 4 fig, ax = plt.subplots() 5 g = ig.Graph.Famous("petersen") ----> 6 ig.plot(g, target=ax) 8 plt.show()
File
~/anaconda3/envs/rapids-2208/lib/python3.8/site-packages/igraph/drawing/__init__.py:245, in plot(obj, target, bbox, *args, **kwds)
243 return 244 else:
--> 245 plotter( 246 backend, 247 target, 248 palette=palette, 249 *args, 250 **kwds, 251 ) 252 return target 254 # Cairo backend
File
~/anaconda3/envs/rapids-2208/lib/python3.8/site-packages/igraph/drawing/graph.py:558, in __plot__(self, backend, context, *args, **kwds)
552 from igraph.drawing import DrawerDirectory 554 drawer = kwds.pop( 555 "drawer_factory", 556 DrawerDirectory.resolve(self, backend)(context), 557 )
--> 558 drawer.draw(self, *args, **kwds)
File
~/anaconda3/envs/rapids-2208/lib/python3.8/site-packages/igraph/drawing/matplotlib/graph.py:233, in MatplotlibGraphDrawer.draw(self, graph, *args, **kwds)
231 drawer_method = vertex_drawer.draw 232 for vertex, visual_vertex, coords in vertex_coord_iter:
--> 233 drawer_method(visual_vertex, vertex, coords) 235 # Construct the iterator that we will use to draw the vertex
labels
236 vs = graph.vs
File
~/anaconda3/envs/rapids-2208/lib/python3.8/site-packages/igraph/drawing/matplotlib/vertex.py:60, in MatplotlibVertexDrawer.draw(self, visual_vertex, vertex, coords)
49 width = ( 50 visual_vertex.width 51 if visual_vertex.width is not None 52 else visual_vertex.size 53 ) 54 height = ( 55 visual_vertex.height 56 if visual_vertex.height is not None 57 else visual_vertex.size 58 )
---> 60 stroke = visual_vertex.shape.draw_path( 61 ax, 62 coords[0], 63 coords[1], 64 width, 65 height, 66 facecolor=visual_vertex.color, 67 edgecolor=visual_vertex.frame_color, 68 linewidth=visual_vertex.frame_width, 69 zorder=visual_vertex.zorder, 70 ) 71 ax.add_patch(stroke)
File
~/anaconda3/envs/rapids-2208/lib/python3.8/site-packages/igraph/drawing/shapes.py:168, in CircleDrawer.draw_path(ctx, center_x, center_y, width, height, **kwargs)
166 return mpl.patches.Circle((center_x, center_y), width / 2,
**kwargs) 167 else: --> 168 ctx.arc(center_x, center_y, width / 2, 0, 2 * pi)
AttributeError: 'AxesSubplot' object has no attribute 'arc'
Not sure if its my python or package versions, or if its a configuration issue, or possibly an issue with igraph or matplotlib. Any advice would be most welcome
graph-tool mailing list -- graph-tool@skewed.de To unsubscribe send an email to graph-tool-leave@skewed.de
-- Tiago de Paula Peixoto tiago@skewed.de
graph-tool mailing list -- graph-tool@skewed.de To unsubscribe send an email to graph-tool-leave@skewed.de