scripts/plot_ind.py
def visualize_individual(repr_, freq, dir_path, name):
    """Visualize graphically the tree that represents the individual.
    
    Arguments:
        repr_ -- Representation of the individual to be visualized.
    """

    dot_dir_path = "{}/dot".format(dir_path)
    png_dir_path = "{}/png".format(dir_path)

    if not os.path.exists(dot_dir_path):
        os.makedirs(dot_dir_path)
    if not os.path.exists(png_dir_path):
        os.makedirs(png_dir_path)

    dot_file_path = "{}/{}.dot".format(dot_dir_path, name)
    png_file_path = "{}/{}.png".format(png_dir_path, name)

    labels, edges = parse_repr(repr_)

    g = nx.DiGraph()

    # Use HTML like syntax so title can have padding from graph
    g.graph['graph']={"label" : "<Frequency = {} <br/> <br/> <br/>>".format(freq), "labelloc" : "t"}

    for key, value in labels.items():
        g.add_node(key, style="filled", label=value[0], fillcolor=value[1])
    g.add_edges_from(edges)

    write_dot(g, dot_file_path)
    shell_call("dot -Tpng -Gdpi=300 {} > {}".format(dot_file_path, png_file_path))
Visualize graphically the tree that represents the individual.
    
    Arguments:
        repr_ -- Representation of the individual to be visualized.
    
Visualize graphically the tree that represents the individual.
Arguments:
repr_ -- Representation of the individual to be visualized.
Visualize graphically the tree that represents the individual . Arguments : repr_ -- Representation of the individual to be visualized .
def visualize_individual(repr_, freq, dir_path, name):
    dot_dir_path = "{}/dot".format(dir_path)
    png_dir_path = "{}/png".format(dir_path)
    if not os.path.exists(dot_dir_path):
        os.makedirs(dot_dir_path)
    if not os.path.exists(png_dir_path):
        os.makedirs(png_dir_path)
    dot_file_path = "{}/{}.dot".format(dot_dir_path, name)
    png_file_path = "{}/{}.png".format(png_dir_path, name)
    labels, edges = parse_repr(repr_)
    g = nx.DiGraph()
    g.graph['graph']={"label" : "<Frequency = {} <br/> <br/> <br/>>".format(freq), "labelloc" : "t"}
    for key, value in labels.items():
        g.add_node(key, style="filled", label=value[0], fillcolor=value[1])
    g.add_edges_from(edges)
    write_dot(g, dot_file_path)
    shell_call("dot -Tpng -Gdpi=300 {} > {}".format(dot_file_path, png_file_path))
def visualize_individual ( repr_ , freq , dir_path , name ) : dot_dir_path = "{}/dot" . format ( dir_path ) png_dir_path = "{}/png" . format ( dir_path ) if not os . path . exists ( dot_dir_path ) : os . makedirs ( dot_dir_path ) if not os . path . exists ( png_dir_path ) : os . makedirs ( png_dir_path ) dot_file_path = "{}/{}.dot" . format ( dot_dir_path , name ) png_file_path = "{}/{}.png" . format ( png_dir_path , name ) labels , edges = parse_repr ( repr_ ) g = nx . DiGraph ( ) g . graph [ 'graph' ] = { "label" : "<Frequency = {} <br/> <br/> <br/>>" . format ( freq ) , "labelloc" : "t" } for key , value in labels . items ( ) : g . add_node ( key , style = "filled" , label = value [ 0 ] , fillcolor = value [ 1 ] ) g . add_edges_from ( edges ) write_dot ( g , dot_file_path ) shell_call ( "dot -Tpng -Gdpi=300 {} > {}" . format ( dot_file_path , png_file_path ) )
Visualize graphically the tree that represents the individual.
Visualize graphically the tree that represents the individual .
"""Visualize graphically the tree that represents the individual.
    
    Arguments:
        repr_ -- Representation of the individual to be visualized.
    """ # Use HTML like syntax so title can have padding from graph
repr_
freq
dir_path
name