Exemplo n.º 1
0
for e in taxg.edges():
    src = e.source()
    tgt = e.target()
    if not verts[src]:
        verts[src] = 1
        pos[src] = [0.0, 0.0]
        vcolor[src] = 'red'
    if not verts[tgt]:
        verts[tgt] = 1
        pos[tgt] = [0.0, 0.0]
        vcolor[tgt] = 'red'
    if not edges[e]:
        edges[e] = 1
        ecolor[e] = 'red'
        ewidth[e] = 1.0
        gv.wt[e] = 1.0

pos = gt.sfdp_layout(gv, pos=pos, pin=pin, eweight=gv.wt, multilevel=False)

gt.interactive_window(gv,
                      pos=pos,
                      pin=True,
                      vertex_fill_color=vcolor,
                      vertex_text_position=3.1415,
                      vertex_text=taxg.vertex_name,
                      vertex_size=vsize,
                      edge_color=ecolor,
                      edge_pen_width=ewidth,
                      update_layout=False)
Exemplo n.º 2
0
for e in taxg.edges():
    src = e.source()
    tgt = e.target()
    if not verts[src]:
        verts[src] = 1
        pos[src] = [0.0, 0.0]
        vcolor[src] = 'red'
    if not verts[tgt]:
        verts[tgt] = 1
        pos[tgt] = [0.0, 0.0]
        vcolor[tgt] = 'red'
    if not edges[e]:
        edges[e] = 1
        ecolor[e] = 'red'
        ewidth[e] = 1.0
        gv.wt[e] = 1.0

pos = gt.sfdp_layout(gv, pos=pos, pin=pin, eweight=gv.wt, multilevel=False)

gt.interactive_window(
    gv, pos=pos, pin=True,
    vertex_fill_color=vcolor,
    vertex_text_position=3.1415,
    vertex_text=taxg.vertex_name,
    vertex_size=vsize,
    edge_color=ecolor,
    edge_pen_width=ewidth,
    update_layout=False
    )
Exemplo n.º 3
0
deg.fa = 2*(numpy.sqrt(deg.fa)*0.5  + 0.4)
edg = f_g.edge_properties['cofield']
edg.fa = (numpy.sqrt(edg.fa)*0.6+1)
ebet = gt.betweenness(f_g)[1]

# <codecell>


# <codecell>

pos, int = gt.interactive_window(u, pos=gt.radial_tree_layout(f_g, f_g.vertex(1)),
                         vertex_size = deg, 
                         vertex_fill_color = v_comm, 
                         vertex_text = f_g.vertex_properties['field'],
                         vertex_text_position = 0.2,
                         vertex_font_size = 9,
                         vertex_font_family = 'sans serif',
                         edge_pen_width = edg,
                         edge_color=ebet,
                         output_size = (800,1200)
                         )

# <codecell>


# <codecell>

gt.graph_draw(f_g, pos=pos, 
              vertex_size = deg, 
                        vertex_fill_color = v_comm, 
                        vertex_text = f_g.vertex_properties['field'],
Exemplo n.º 4
0
vtext = gv.new_vertex_property('string')
for v in gv.vertices():
    if v.out_degree():
        s = taxg.vertex_name[v]
        vtext[v] = s

dprops = gv.new_vertex_property('string')
for v in gv.vertices():
    st = str(list(taxg.vertex_strees[v]))
    s = taxg.vertex_name[v]
    if not s:
        s = str([ taxg.taxid_name(x) for x in taxg.vertex_stem_cdef[v] ])
    s = '%s: %s' % (st, s)
    dprops[v] = s
    
pos, pin = tg.layout(taxg, gv, root, sfdp=True, deg0=190.0,
                     degspan=160.0, radius=1000)

gt.interactive_window(
    gv, pos=pos, pin=True,
    vertex_fill_color=vcolor,
    vertex_text_position=3.1415,
    vertex_text=vtext,
    vertex_size=vsize,
    vertex_pen_width=0,
    edge_color=ecolor,
    edge_pen_width=ewidth,
    display_props=dprops,
    update_layout=False
    )
Exemplo n.º 5
0
dprops = gv.new_vertex_property('string')
for v in gv.vertices():
    st = str(list(taxg.vertex_strees[v]))
    s = taxg.vertex_name[v]
    if not s:
        s = str([taxg.taxid_name(x) for x in taxg.vertex_stem_cdef[v]])
    s = '%s: %s' % (st, s)
    dprops[v] = s

pos, pin = tg.layout(taxg,
                     gv,
                     root,
                     sfdp=True,
                     deg0=190.0,
                     degspan=160.0,
                     radius=1000)

gt.interactive_window(gv,
                      pos=pos,
                      pin=True,
                      vertex_fill_color=vcolor,
                      vertex_text_position=3.1415,
                      vertex_text=vtext,
                      vertex_size=vsize,
                      vertex_pen_width=0,
                      edge_color=ecolor,
                      edge_pen_width=ewidth,
                      display_props=dprops,
                      update_layout=False)