Skip to content

matplotlib backend does not handle multigraphs / reciprocal edges #685

@szhorvat

Description

@szhorvat

Describe the bug

Unlike the Cairo backend, the matplotlib backend does not handle multi-edges, or even reciprocal edges in directed graphs. Edges are plotted on top of each other, making it impossible to label or style them separately.

To reproduce

import igraph as ig
import matplotlib.pyplot as plt

g = ig.Graph([(0,1), (1,0), (1,2), (2,0)], directed=True)

fig, ax = plt.subplots()
ig.plot(g, target=ax)
image

Compare with Cairo:

ig.plot(g, bbox=(300,300))
image

Version information

Current main, 28647e7

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions