Skip to content

Strange Axis BoundingBox "diamond" #79

Open
@rtbs-dev

Description

Running into a pretty consistent "diamond" bound on my node layouts for some reason. I've tried playing with many layout settings, but so far it only changes the sizes within this odd diamond.

Here's a min. example:

from netgraph import Graph
Graph(G) # pre-existing NX graph
plt.show()

image

Adjusting the scale doesn't seem to do anything to the boundary:

Graph(G, scale=(2,2))

image

Replicating in networkx:

nx.draw_networkx_nodes(
    G, pos=(testpos:=nx.fruchterman_reingold_layout(G)), 
    node_color='white', edgecolors='k', 
    node_size=50, linewidths=0.5,
)
nx.draw_networkx_edges(
    G, pos=testpos
)

image

So I don't think my networkx layouts are reaching some kind of border.

Similarly, the diamond starts appearing for the karate graph:

Graph(nx.karate_club_graph(), scale=(2,2))

image

vs:

nx.draw_networkx_nodes(
    K:=nx.karate_club_graph(), pos=(testpos:=nx.fruchterman_reingold_layout(K)), 
    node_color='white', edgecolors='k', 
    node_size=100, linewidths=0.5,
)
nx.draw_networkx_edges(
    K, pos=testpos
)

image

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions