def merge(args):
    """
    %prog merge graphs

    Merge multiple graphs together and visualize.
    """
    p = OptionParser(merge.__doc__)
    p.add_option("--colorlist", default="black,red,pink,blue,green",
                 help="The color palette [default: %default]")
    opts, args = p.parse_args(args)

    if len(args) < 1:
        sys.exit(not p.print_help())

    colorlist = opts.colorlist.split(",")
    assert len(colorlist) >= len(args), "Need more colors in --colorlist"

    g = BiGraph()
    for a, c in zip(args, colorlist):
        g.read(a, color=c)

    g.draw("merged.png")
def merge ( args ) : p = OptionParser ( merge . __doc__ ) p . add_option ( "--colorlist" , default = "black,red,pink,blue,green" , help = "The color palette [default: %default]" ) opts , args = p . parse_args ( args ) if len ( args ) < 1 : sys . exit ( not p . print_help ( ) ) colorlist = opts . colorlist . split ( "," ) assert len ( colorlist ) >= len ( args ) , "Need more colors in --colorlist" g = BiGraph ( ) for a , c in zip ( args , colorlist ) : g . read ( a , color = c ) g . draw ( "merged.png" )
%prog merge graphs

    Merge multiple graphs together and visualize.