原文出处:http:///?p=23这是“政治博客圈和2004年美国大选”中的政治博客网络图,但是边缘束是使用随机块模型确定的(注:下图与图相同(即,布局和数据相同))。 Tiago论文中的5-我只是在上面放了一个黑色背景 。 边缘配色方案与Adamic和Glance的原始论文中的相同,即每个节点对应一个博客URL,颜色反映政治取向,红色代表保守派,蓝色代表自由派。橙色边从自由派博客到保守派博客,紫色边从保守派到自由派(参见Adamic和Glance中的图1)。 颜色方案与原始论文中的颜色方案相同,即每个节点对应一个博客URL,颜色反映政治取向,红色代表保守派,蓝色代表自由派。橙色边从自由派博客到保守派博客,紫色边从保守派到自由派(参见Adamic和Glance中的图1)。绘制了所有1,490个节点和19,090条边。 每个博客的网址都在每个节点旁边绘制,这是一个特写:
使颜色正确需要一些调整: Republican, 2->Democrat\nred_blue_map = {1:(1,0,0,1),0:(0,0,1,1)}\nplot_color = g.new_vertex_property('vector')\ng.vertex_properties['plot_color'] = plot_color\nfor v in g.vertices():\n plot_color[v] = red_blue_map[g.vertex_properties['value'][v]]","classes":[]}" data-cke-widget-upcasted="1" data-cke-widget-keep-attr="0" data-widget="codeSnippet"> 为了使用分层边缘捆绑算法,我们首先需要进行某种聚类。一种明显的方法是根据其政治隶属关系为每个节点分配一个群集: 这些集群用于形成一个层次结构,该层次结构使人们可以轻松确定标准的树布局(如下图所示)。通过沿树内插来绘制层次边缘束。 这是上图使用的树: 最后,我们设置文本旋转并保存图形: 0:\n text_rot[v] = math.atan(pos[v][1]/pos[v][0])\n else:\n text_rot[v] = math.pi + math.atan(pos[v][1]/pos[v][0])\n\ngt.graph_draw(g, pos=pos,\n vertex_size=10,\n vertex_color=g.vertex_properties['plot_color'],\n vertex_fill_color=g.vertex_properties['plot_color'],\n edge_control_points=cts,\n vertex_text=g.vertex_properties['label'],\n vertex_text_rotation=g.vertex_properties['text_rot'],\n vertex_text_position=1,\n vertex_font_size=9,\n edge_color=g.edge_properties['edge_color'],\n vertex_anchor=0,\n bg_color=[0,0,0,1],\n output_size=[4024,4024],\n output='polblogs.png')","classes":[]}" data-cke-widget-upcasted="1" data-cke-widget-keep-attr="0" data-widget="codeSnippet"> |
|