planar_layout#

planar_layout(G, scale=1, center=None, dim=2)[源代码]#

定位没有边缘交点的节点。

参数
G网络X图表或节点列表

将为G中的每个节点分配一个位置。如果G的类型为nx.PlanarEmbedding,则相应地选择位置。

scale编号(默认:1)

位置的比例因子。

center类似数组或无

要围绕其居中布局的坐标对。

dim集成

布局的维度。

返回
posDICT

按节点设置关键字的位置词典

加薪
NetworkXException

如果g不是平面的

实例

>>> G = nx.path_graph(4)
>>> pos = nx.planar_layout(G)