How can one set the size of an igraph plot?

。_饼干妹妹 提交于 2021-02-07 18:26:30

问题


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

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.

Here's how it looks right now: current plot


回答1:


From thie python igraph tutorial

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)


来源:https://stackoverflow.com/questions/24597523/how-can-one-set-the-size-of-an-igraph-plot

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!