Here is a quick example. I also just noticed I get a warning if
overlap='prism'. Thanks for the help.

    import graph_tool.all as gt

    #Setup graph
    g = gt.Graph(directed=False)
    center = g.add_vertex()
    for _ in xrange(150):
        v = g.add_vertex()
        g.add_edge(v, center)
    #Set node properties
    vertex_size = g.new_vertex_property('int32_t')
    vertex_size.a = 1
    vertex_size[center] = 10

    # Draw graphs - 5 examples
    # Ex 1 - All nodes size 1 -> works
    gt.graphviz_draw(g, vsize=1, output='ex_size1.pdf', overlap='scale')
    # Ex 2 - All nodes size 4 -> 1 node may be drawn, typically a blank
canvas
    gt.graphviz_draw(g, vsize=4, output='ex_size4.pdf', overlap='scale')
    # Ex 3 - Large center vertex -> works with 'scale'
    gt.graphviz_draw(g, vsize=vertex_size, output='ex_scale.pdf',
overlap='scale')
    # Ex 4 - Large center vertex -> blank canvas with False
    gt.graphviz_draw(g, vsize=vertex_size, output='ex_False.pdf',
overlap='False')
    # Ex 5 - Prism warning -> still draws
    gt.graphviz_draw(g, output='example_prism.pdf', overlap="prism")
    # --> Warning: Overlap value "prism" unsupported - ignored
    # I thought Prism was the default value. Why do I only get this message
    #   if I set it explicitly?



--
View this message in context: 
http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/Accounting-for-vertex-size-when-setting-the-layout-tp4026511p4026530.html
Sent from the Main discussion list for the graph-tool project mailing list 
archive at Nabble.com.
_______________________________________________
graph-tool mailing list
[email protected]
https://lists.skewed.de/mailman/listinfo/graph-tool

Reply via email to