Skip to content

Matplotlib and Cairo layouts do not look the same #482

Open
@vtraag

Description

@vtraag

Describe the bug
The layout coordination systems in matplotlib and cairo are using inverted y-axis from each other.

To reproduce

g = ig.Graph.Famous('Zachary')
ig.plot(g)

yields

image

while

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

yields
image

It would be nice if the two coordination systems would align. Of course, I understand that both systems have their own drawing systems and Cairo probably uses a top-left coordinate system (i.e. positive y-axis goes down in the picture) while matplotlib uses a figure coordinate system (i.e. positive y-axis goes up in the picture). To me, it seems most natural to stick to a matplotlib type coordinate system. Could we perhaps simply always invert the y coordinate before drawing in Cairo?

Version information
Development version from develop branch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    todoTriaged for implementation in some unspecified future version

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions