I am using iGraph for python to draw some graphs and I cannot seem to prevent the nodes from hitting the edge of the image, especially with very few nodes. In cases with thousands of nodes the opposite is actually true, they are too clustered in the center. Is there a way to influence the behavior of the layout to control the density of the nodes, or at least stop them from getting cut off? here is the code so far:
visual_style = {}
visual_style["vertex_size"] = sz
visual_style["layout"] = gg.layout_fruchterman_reingold()
visual_style["bbox"] = (4000, 4000)
visual_style["margin"] = 20
visual_style["edge_arrow_size"] = 0
visual_style["edge_color"] = 'White'
visual_style['edge_width'] = ew
visual_style["edge_curved"] = .2
# print(visual_style)
plot(gg,"./images/"+str(i)+".png", autocurve=True, background='Black',asp=0, **visual_style)
the graphML file I am importing contains this data:
<?xml version='1.0' encoding='utf-8'?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
<key id="d0" for="node" attr.name="color" attr.type="string" />
<key id="d1" for="node" attr.name="shape" attr.type="string" />
<graph edgedefault="undirected">
<node id="16">
<data key="d0">#ffb812</data>
<data key="d1">triangle</data>
</node>
<node id="3594">
<data key="d0">#00b8ce</data>
<data key="d1">circle</data>
</node>
<node id="9951">
<data key="d0">#00b8ce</data>
<data key="d1">circle</data>
</node>
<node id="11439">
<data key="d0">#00b8ce</data>
<data key="d1">circle</data>
</node>
<node id="13349">
<data key="d0">#00b8ce</data>
<data key="d1">circle</data>
</node>
<edge source="16" target="3594" />
<edge source="3594" target="9951" />
<edge source="9951" target="11439" />
<edge source="9951" target="13349" />
</graph>
</graphml>