[Python] Graph visualization: how to generate ForceAtlas2 layout with square border

Discussão em 'Python' iniciado por Stack, Setembro 8, 2025.

  1. Stack

    Stack Membro Participativo

    I'm trying to reproduce the example graph visualization (see below) from this blog. I am using Python and cugraph.force_atlas2 from RAPIDS to generate the ForceAtlas2 layout. The problem is that no matter how I adjust the parameters, the vertices are always laid out in a roughly round shape. However, in the example graph viz, the vertices are clearly bounded within a square. I would like to know how this could be done. Are there any transformations or parameters I am missing? Thanks.

    [​IMG]
    My typical call of cugraph.force_atlas2 is like this:

    cugraph.force_atlas2(G,
    max_iter=500,
    pos_list=None,
    outbound_attraction_distribution=True,
    lin_log_mode=False,
    edge_weight_influence=1.0,
    jitter_tolerance=1.0,
    barnes_hut_optimize=True,
    barnes_hut_theta=1.0,
    scaling_ratio=2.0,
    strong_gravity_mode=False,
    gravity=1.0,
    verbose=False,
    callback=None)

    Continue reading...

Compartilhe esta Página