我目前正在绘制这样的图形:
I'm currently plotting my graphs like this:
ig.plot(graph, target=file, vertex_color=membership, vertex_label=[index for index, value in enumerate(graph.vs)], vertex_frame_width=0, palette=ig.ClusterColoringPalette(len(set(membership)) + 3))该图将输出到一页上的PDF文件中.看起来不错,但是节点太拥挤了.有没有办法将节点拉开,以便我实际上可以看到所有边缘?我当时想增加地块的面积,但我不知道该怎么做.
The plot is output to a PDF file on a single page. It looks decent but the nodes are too crowded. Is there a way to pull the nodes apart so that I can actually see all the edges? I was thinking of increasing the size of the plot but I don't know how to do that.
这是现在的样子:
推荐答案来自python python igraph教程
From thie python igraph tutorial
布局对象还包含一些有用的方法来批量翻译,缩放或旋转坐标.但是,布局对象的主要用途是可以将它们与图形一起传递给plot()函数以获得2D绘图
Layout objects also contain some useful methods to translate, scale or rotate the coordinates in a batch. However, the primary utility of Layout objects is that you can pass them to the plot() function along with the graph to obtain a 2D drawing
visual_style["layout"] = layout visual_style["bbox"] = (300, 300) visual_style["margin"] = 10 plot(g, **visual_style)更多推荐
如何设置igraph图的大小?
发布评论