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

Plotting: multiple self-loops on a vertex are plotted on top of each other #321

Open
szhorvat opened this issue Aug 4, 2020 · 8 comments
Labels
todo Triaged for implementation in some unspecified future version

Comments

@szhorvat
Copy link
Member

szhorvat commented Aug 4, 2020

When a vertex has multiple self-loops, they are plotted on top of each other. The graphs 0-0 and 0-0, 0-0 are not visually distinguishable when plotted.

These two graphs look the same:

plot(Graph([(0,0),(0,0)]))
plot(Graph([(0,0)]))

Related: igraph/rigraph#407

@szhorvat
Copy link
Member Author

szhorvat commented Aug 4, 2020

I realize this is not easy. For some inspiration, Mathematica visualizes these like this:

image

As you can see, a nice solution will consider not only other self loops, but also the position of other non-loop edges.

@stale
Copy link

stale bot commented Oct 3, 2020

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.

@stale stale bot added the stale label Oct 3, 2020
@szhorvat szhorvat added the todo Triaged for implementation in some unspecified future version label Oct 3, 2020
@stale stale bot removed the stale label Oct 3, 2020
@iosonofabio
Copy link
Member

Is this still present in the matplotlib interface?

@ntamas ntamas added the plotting Issues related to plotting graphs in igraph in general label May 20, 2021
@ntamas ntamas removed the plotting Issues related to plotting graphs in igraph in general label Nov 23, 2021
@ntamas
Copy link
Member

ntamas commented Nov 23, 2021

The Matplotlib backend seems to be better in handling multiple self-loops; just tested this now in Google Colab.

@szhorvat
Copy link
Member Author

Is this still present in the matplotlib interface?

Yes, here's an example:

ig.plot(ig.Graph.Formula('a-b-c-c-c-c-a-b', simplify=False))

image

@iosonofabio
Copy link
Member

Is this the develop branch? If not please test with that

@szhorvat
Copy link
Member Author

szhorvat commented Dec 12, 2021

Yes, it is with the latest develop branch.

Should this work? I vaguely remembered that you fixed this, so I was actually surprised to see that it didn't work.

@szhorvat
Copy link
Member Author

@iosonofabio I remembered correctly, you did fix it. It works in the released version, but it does not work on develop. Here's what I get with 0.9.8:

image

ig.plot(ig.Graph.Formula('a-b-c-c-c-c-a-b', simplify=False), target=plt.axes())

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
todo Triaged for implementation in some unspecified future version
Projects
None yet
Development

No branches or pull requests

3 participants