如何设置igraph图的大小?

编程入门 行业动态 更新时间:2024-10-27 19:16:20
本文介绍了如何设置igraph图的大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我目前正在绘制这样的图形:

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图的大小?

本文发布于:2023-07-18 08:25:16,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1142820.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何设置   大小   igraph

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!