Skip to content
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

Strange drawing behavior for large edges #466

Closed
nwlandry opened this issue Sep 1, 2023 · 4 comments
Closed

Strange drawing behavior for large edges #466

nwlandry opened this issue Sep 1, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@nwlandry
Copy link
Collaborator

nwlandry commented Sep 1, 2023

For

import xgi
H = xgi.sunflower(3, 1, 50)
xgi.draw(H, node_size=5)

the plot looks like
image

@nwlandry nwlandry added the bug Something isn't working label Sep 1, 2023
@maximelucas
Copy link
Collaborator

What specifically do you think should be different?

I guess this hypergraph has 3 edges of size 50, so each hyperedge should almost look like a regular polygon, or at least some convex shape. And the we could ideally want the center node to be closer to the "flowers"?

I tried playing with the spring strength k of the layout and managed to get this:

import xgi
H = xgi.sunflower(3, 1, 50)

pos = xgi.barycenter_spring_layout(H, k=0.25)
xgi.draw(H, node_size=5, pos=pos)
Screenshot 2023-09-01 at 17 08 24

@nwlandry
Copy link
Collaborator Author

nwlandry commented Sep 1, 2023

It seems weird to me that despite very few constraints that the edge isn't convex.

@maximelucas
Copy link
Collaborator

@nwlandry I think you investigated this but I don't remember the conclusion. Should this be closed?

@nwlandry
Copy link
Collaborator Author

Thanks for the reminder, @maximelucas! You're right. The issue is that the edges are not necessarily convex, but this was addressed with the draw_hypergraph_hull() function introduced in PR #320 authored by @thomasrobiglio.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants