Skip to content

Commit e5899ed

Browse files
committed
fix: fix auto-curving of edges with the Matplotlib backend, closes #685
1 parent 4245a6c commit e5899ed

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

src/igraph/drawing/matplotlib/graph.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ def __init__(
165165

166166
def _kwds_post_update(self):
167167
self.kwds["layout"] = self.ensure_layout(self.kwds["layout"], self.graph)
168-
self.edge_curved = self._set_edge_curve(**self.kwds)
168+
self.kwds["edge_curved"] = self._set_edge_curve(**self.kwds)
169169
self._clear_state()
170170
self.stale = True
171171

Loading

tests/drawing/matplotlib/test_graph.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,15 @@ def test_gh_587(self):
105105
plot(g, target="graph_basic.png", layout=self.layout_small_ring)
106106
os.unlink("graph_basic.png")
107107

108+
@image_comparison(baseline_images=["graph_with_curved_edges"])
109+
def test_graph_with_curved_edges(self):
110+
plt.close("all")
111+
g = Graph.Ring(24, directed=True, mutual=True)
112+
fig, ax = plt.subplots()
113+
lo = g.layout("circle")
114+
lo.scale(3)
115+
plot(g, target=ax, layout=lo)
116+
108117

109118
class ClusteringTestRunner(unittest.TestCase):
110119
def setUp(self):

0 commit comments

Comments
 (0)