GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [pyos][visualization] Reciprocal directed edges overlap · Issue #474 · python-graphblas/python-graphblas

[pyos][visualization] Reciprocal directed edges overlap #474

New issue
Copy link
New issue
Copy link
Open
Open
[pyos][visualization] Reciprocal directed edges overlap#474
Copy link

Description

@szhorvat
szhorvat
opened on Jun 25, 2023
Issue body actions

When 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)
image

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

Activity

  1. eriknw commented on Jun 26, 2023

    @eriknw
    eriknw
    on Jun 26, 2023
    Member
    More actions

    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.

    • https://netgraph.readthedocs.io/en/latest/sphinx_gallery_output/index.html
    • https://graph-tool.skewed.de/

    I think @paul-tqh-nguyen may be interested in looking into visualization

  2. szhorvat commented on Jun 26, 2023

    @szhorvat
    szhorvat
    on Jun 26, 2023
    Author
    More actions

    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.

  3. eriknw commented on Jun 29, 2023

    @eriknw
    eriknw
    on Jun 29, 2023
    Member
    More actions

    Thanks for letting us know about viz in igraph!

    After a quick scan of examples, it's not clear to me how viz from igraph would be able to handle showing the edge attributes of reciprocal edges any better: https://python.igraph.org/en/latest/tutorials/index.html

  4. szhorvat commented on Jun 29, 2023

    @szhorvat
    szhorvat
    on Jun 29, 2023
    Author
    More actions

    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.

  5. szhorvat commented on Jun 30, 2023

    @szhorvat
    szhorvat
    on Jun 30, 2023
    Author
    More actions

    @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)
    
    image
    Reacted by Sultan Orazbayev and Erik Welch
  6. eriknw commented on Jul 11, 2023

    @eriknw
    eriknw
    on Jul 11, 2023
    Member
    More actions

    Nice, thanks!

  7. eriknw
    added 2 commits that reference this issue on Aug 6, 2026

    Fix viz.datashade cell positioning and separate reciprocal edges in v…

    80a2f44

    Fix viz.datashade cell positioning and separate reciprocal edges in v…

    1f1e16d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.