コード例 #1
0
def plot_init():

    fig, (ax1, ax2) = plt.subplots(2)
    ax1.set_aspect(aspect=1)
    vis.lattice_grid(N,1,ax1)###
    positions1_1, positions1_2, positions2_2, positions2_1= vis.lattice2positions(L1, L2,ax1)
    return positions1_1, positions1_2, positions2_2, positions2_1,fig, ax1, ax2
コード例 #2
0
def plot_init():

    fig, ax = plt.subplots()
    ax.set_aspect(aspect=1)
    vis.lattice_grid(N, 2, ax)  ###
    positions1_1, positions1_2, positions2_2, positions2_1 = vis.lattice2positions(
        L1, L2, ax)
    return positions1_1, positions1_2, positions2_2, positions2_1, ax
コード例 #3
0
while j < steps:  #True:#
    print("j: ", j)
    fig, ax = plt.subplots()
    ax.set_aspect(aspect=1)
    #vis.lattice_grid(N,1,ax)#vis.lattice_grid(N,2,ax)

    #site = int(input("ch: "))#rd.randint(0,2*N+2)
    site = rd.randint(0, 2 * N + 2)
    #print(site)
    update_anim(site, ax)
    #print(update_par(site, 1,1,1,1,1,1,1,1))
    #print(stuck_position())
    DisplayNice()

    positions1_1, positions1_2, positions2_2, positions2_1 = vis.lattice2positions(
        L1, L2, ax)
    vis.lattice_points(positions1_1, 0, "b", ax)
    vis.lattice_points(positions1_2, 0, "r", ax)
    vis.lattice_points(N - 1 - positions2_2, 1, "r",
                       ax)  #to flip it N-1-positions_vect
    vis.lattice_points(N - 1 - positions2_1, 1, "b", ax)
    plt.close('all')
    #outpath = '../../img/visualiser/'
    #plt.savefig(path.join(outpath,"%s-.png"%(j)))###
    #j+=1###
'''
    positions1_1, positions1_2, positions2_2, positions2_1 = vis.lattice2positions(L1, L2,ax)
    vis.lattice_points(positions1_1, 0, "b", ax)
    vis.lattice_points(positions1_2, 0, "r", ax)
    vis.lattice_points(N-1-positions2_2, 1, "r", ax)#to flip it N-1-positions_vect
    vis.lattice_points(N-1-positions2_1, 1, "b", ax)