Skip to content

Commit

Permalink
fix: fix auto-curving of edges with the Matplotlib backend, closes #685
Browse files Browse the repository at this point in the history
  • Loading branch information
ntamas committed Jun 30, 2023
1 parent 4245a6c commit e5899ed
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/igraph/drawing/matplotlib/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def __init__(

def _kwds_post_update(self):
self.kwds["layout"] = self.ensure_layout(self.kwds["layout"], self.graph)
self.edge_curved = self._set_edge_curve(**self.kwds)
self.kwds["edge_curved"] = self._set_edge_curve(**self.kwds)
self._clear_state()
self.stale = True

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions tests/drawing/matplotlib/test_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,15 @@ def test_gh_587(self):
plot(g, target="graph_basic.png", layout=self.layout_small_ring)
os.unlink("graph_basic.png")

@image_comparison(baseline_images=["graph_with_curved_edges"])
def test_graph_with_curved_edges(self):
plt.close("all")
g = Graph.Ring(24, directed=True, mutual=True)
fig, ax = plt.subplots()
lo = g.layout("circle")
lo.scale(3)
plot(g, target=ax, layout=lo)


class ClusteringTestRunner(unittest.TestCase):
def setUp(self):
Expand Down

0 comments on commit e5899ed

Please sign in to comment.