#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Create and draw a star with varying node properties.

"""
#    Copyright (C) 2006 by 
#    <NAME> <<EMAIL>>
#    <NAME> <<EMAIL>>
#    <NAME>, http://www.cs.brown.edu/~er/
#    Distributed with BSD license.     
#    All rights reserved, see LICENSE for details.

from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division

__author__ = """<NAME> (<EMAIL>)"""

from pygraphviz import *

A=AGraph()

# set some default node attributes
A.node_attr['style']='filled'
A.node_attr['shape']='circle'
A.node_attr['fixedsize']='true'
A.node_attr['fontcolor']='#FFFFFF'

# make a star in shades of red
for i in range(16):
    A.add_edge(0,i)
    n=A.get_node(i)
    n.attr['fillcolor']="#%2x0000"%(i*16)
    n.attr['height']="%s"%(i/16.0+0.5)
    n.attr['width']="%s"%(i/16.0+0.5)

print(A.string()) # print to screen
A.write("star.dot") # write to simple.dot
print("Wrote star.dot")
A.draw('star.png',prog="circo") # draw to png using circo
print("Wrote star.png")

#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Create and draw a star with varying node properties.

"""
#    Copyright (C) 2006 by 
#    <NAME> <<EMAIL>>
#    <NAME> <<EMAIL>>
#    <NAME>, http://www.cs.brown.edu/~er/
#    Distributed with BSD license.     
#    All rights reserved, see LICENSE for details.

from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division

__author__ = """<NAME> (<EMAIL>)"""

from pygraphviz import *

A=AGraph()

# set some default node attributes
A.node_attr['style']='filled'
A.node_attr['shape']='circle'
A.node_attr['fixedsize']='true'
A.node_attr['fontcolor']='#FFFFFF'

# make a star in shades of red
for i in range(16):
    A.add_edge(0,i)
    n=A.get_node(i)
    n.attr['fillcolor']="#%2x0000"%(i*16)
    n.attr['height']="%s"%(i/16.0+0.5)
    n.attr['width']="%s"%(i/16.0+0.5)

print(A.string()) # print to screen
A.write("star.dot") # write to simple.dot
print("Wrote star.dot")
A.draw('star.png',prog="circo") # draw to png using circo
print("Wrote star.png")

#!/usr/bin/env python # -*- coding: utf-8 -*- Create and draw a star with varying node properties. #    Copyright (C) 2006 by #    <NAME> <<EMAIL>> #    <NAME> <<EMAIL>> #    <NAME>, http://www.cs.brown.edu/~er/ #    Distributed with BSD license. #    All rights reserved, see LICENSE for details. <NAME> (<EMAIL>) # set some default node attributes # make a star in shades of red # print to screen # write to simple.dot # draw to png using circo