Graph dynamics - layout issues

I'm working on a project wherein I need to dynamically refresh my graph
layout, getting a image for each step of the layout refresh. The problem
is: I can't get the continuity of frames we see in this
My video seems more like a

This problem seems to arise from 2 facts: 1) the way I'm refreshing the
graph - since I'm simply generating another graph (which is not a bigger
problem because the model I'm using is deterministic); 2) max_iter = 2,
instead of 1. But EVEN when I set it to 1, I get no continuity from one
frame to another.

I think it will be useful some parts of the algorithm I'm using, but I
don't know how comprehensible it is:

#main function: makes graphs and save them as images; also save some useful

def graph(a, b, BIN):
    global prop, init_foot, ibin, fbin
    while BIN > fbin:
        print 'while'
        foot = (init_foot)*(10**a)
        BIN = ibin - foot*b
        for i in g.vertices():
            xj = abs(prop[i])+abs((BIN-1)*dP)
            match = gt.find_vertex_range(g,prop,(abs(prop[i]+0.0000000001),
            val = np.array([g.vertex_index[i], len(match), prop[i], BIN])
            for j in xrange(0,len(match)):
                e = g.add_edge(g.vertex_index[i], match[j])
                Rij = (dP - abs(prop[i] - prop[match[j]]))/dP
                R[e] = Rij
        posa = g.vp['pos']
        pos = gt.sfdp_layout(g, pos=posa, max_iter=2)
        gt.graph_draw(g, pos=pos,
vertex_fill_color=Mag,vertex_size=prop_to_size(Mass, mi=3, ma=9.5,
log=False, power=6), fit_view=True, output = '%03d.png' % b)
        #some data I`ll need for analysis
        comp, hist = gt.label_components(g, directed=False)
        compo = len(set(comp.a))
        print g.num_edges(), compo, BIN
        diam1, end = gt.pseudo_diameter(g)
        gg = g.copy()
        deg = g.degree_property_map('out', weight=None)
        lclstr = gt.local_clustering(g, undirected=True)
        gclstr = gt.global_clustering(g)
        #the cases the images start to get too big to compute efficiently
        if b > 1 and components[b] < 350:
            a += 0.1
        if b > 1 and components[b] < 150:
            a += 0.3
        #pace variation
        a +=0.1

    return components, bins, exv, graphs

attachment.html (5.32 KB)

It seems to me that either you are repeating frames, or the layout is
not changing from frame to frame...

Whenever asking for help in this list it is always best to try to reduce
any problem you are observing to a minimal but complete example, so that
others may have a chance of understanding what the problem is.