GeezerVison is showing github.com — [pyos][visualization] Reciprocal directed edges overlap · Issue #474 · python-graphblas/python-graphblas
[pyos][visualization] Reciprocal directed edges overlap #474DescriptionWhen plotting a graph/matrix, reciprocal directed edges overlap. The result is that only the weight of one of them is visible, which is confusing. I believe NetworkX does support curved edges, which could be a solution. However, generally, visualization does not seem to be a priority for NetworkX, so perhaps it's not the best idea to rely on it in the long term.
M = gb.Matrix.from_edgelist([(0,1,10),(1,0,20)], nrows=2, ncols=2)
gb.viz.draw(M)
Both weights, 10 and 20, should be visible, and it should be clear which belongs to which edge.
I think this is important since draw() visualizes matrices specifically as directed graphs, with no undirected option being present.
Part of: pyOpenSci/software-submission#81 Reacted by Sultan Orazbayev Activityeriknw commented on Jun 26, 2023 Yeah, this isn't good. This version of draw was part of the initial PoC that @jim22k created years ago. We do plan to give vizualization a revamp and to show examples by including notebooks in the docs (#407), b/c viz is great for user applications and make great examples.
It might be nifty to be able to use netgraph or graph-tool (or ...) for viz.
I think @paul-tqh-nguyen may be interested in looking into visualization szhorvat commented on Jun 26, 2023 In case you're considering multiple viz backends, igraph does have good supports for both self-loops and multi-edges, and how has a matplotlib back-end. eriknw commented on Jun 29, 2023 szhorvat commented on Jun 29, 2023 I'm sorry about that, it seems that contrary to my memory, multi-edge handling is not yet implemented with the matplotlib backend. It does work with the Cairo backend. szhorvat commented on Jun 30, 2023 @eriknw I need to correct myself again. It seems that multigraph plotting in igraph is broken in the development version, but it's working fine in the released version. Python is not my main language, so I was a bit confused.
To be clear: Yes, multigraph plotting works fine in igraph with either the Cairo or matplotlib backends.
Example:
import igraph as ig
import matplotlib.pyplot as plt
g = ig.Graph([(0,1), (1,0), (1,2), (2,0)], directed=True)
import matplotlib.pyplot as plt
fig, ax= plt.subplots()
ig.plot(g, edge_label=['a','b','c','d'], target=ax)
 Reacted by Sultan Orazbayev and Erik Welch eriknw commented on Jul 11, 2023
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|