-
Notifications
You must be signed in to change notification settings - Fork 249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Matplotlib and Cairo layouts do not look the same #482
Comments
|
I think we should stick to the defaults with Matplotlib and invert the Cairo plot instead. I'd vote for that because it is not nice if igraph messes around with the axis direction of the |
Cairo is also the lower level drawing interface, so there it makes sense that you setup your own coordinate system for drawing. Perhaps it even has direct support for custom coordinate systems? |
In images, the y coordinate is usually top to bottom, I guess that's that @ntamas has done there
…On Wed, Dec 15, 2021, at 16:51, Vincent Traag wrote:
Cairo is also the lower level drawing interface, so there it makes
sense that you setup your own coordinate system for drawing. Perhaps it
even has direct support for custom coordinate systems?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#482 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJFEAFMOU5O6AAN36DMPB3URAUFLANCNFSM5KCC6ZVA>.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Cairo has support for arbitrary transformation matrices so you can "push" a transformation to a Cairo context; this allows you to flip the axes, or scale them, or rotate/skew the whole thing. However, if we flip the Y axis permanently, we break the code for people who have drawn additional stuff on a Cairo context manually, plus we may potentially break the code that aligns labels above/below the vertices. I'd probably mess around with the call to |
|
Something like that, yes. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions. |
Describe the bug
The layout coordination systems in
matplotlib
andcairo
are using inverted y-axis from each other.To reproduce
yields
while
yields
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.The text was updated successfully, but these errors were encountered: