English 中文(简体)
在网络x 中将边缘重量传递到图形格式viz_layout
原标题:Passing edge weights to graphviz_layout in networkx

每个人无法找到如何将加权列表属性的名称传递到 网络中的 Grapviz_layout。 类似 :

nx.spring_layout(G, weight= weight.sum )

但有 nx.graphviz_layout( G,...) 。 也许有人会知道?

问题回答

如果我说对了, 您想要指定用于图形viz布局的边缘属性 。 从 < a href=> http:// netw或kx. lanl.gov/ reference/ generate/ netw或kx. drawing. nx_ agraph. graph. graph. graphviz_layout. html? # graphviz- layout' > Netw或kX docs 中, 我看不出这是可能的 。

然而,图示viz中的布局算法使用了 weight 属性。

:

g = nx.Graph()
g.add_edge(1, 2, { weight : 4})

g.add_edge(1, 2)
g.edge[1][2][ weight ] = 4

g[1][2][ weight ] = 4

If you want to set a default weight f或 the edges, you can pass this as an argument to the graphviz program that you want to use in graphviz_layout:

nx.graphviz_layout(g, prog= dot , args= -Eweight=4 )




相关问题
Very basic WPF layout question

How do I get this listbox to be maxiumum size, i.e. fill the group box its in. I ve tried width="auto" Height="auto", width="stretch" Height="stretch" annoyingly at the moment, it dynamicly sizes to ...

How to align the text to top of TextView?

How to align the text to top of a TextView? Equivalent Android API for Swings setInsets()? that is top of text should start be in (0,0) of TextView <?xml version="1.0" encoding="utf-8"?> <...

Centring a flow in Shoes

Can I center the contents of a flow in Shoes? I know that a paragraph can be centred like: para Centred paragrpah , :align=> center However, this does not work with flows: flow(:align=> ...

Overlaying with CSS

I want to load a website in an iframe, and overlay the website with some hints about the website that is shown. However, i got stuck at the point that the website has a variable passive white space at ...

How do you normally make a program look beautiful? [closed]

How can I make an Application look nice and not like an amateur pulled it together? I mean graphic-wise. Is there some sort of book you can read regarding beautiful program layouts, etc? I put this ...

热门标签