Exemple #1
0
    [[0.05, 0, 0.35, 0.5], [0.6, 0, 0.35, 0.5], [0.25, 0.5, 0.5, 0.5]],
    ['lmncw_*', 'lmnccw_*', 'adn_*']):  # left, bottom, width, height
    ax = fig.add_axes(rect, projection='polar')
    ax.set_ylim(0, 0.5)
    ax.set_autoscale_on(False)
    axes[nme] = ax
canvas = FigureCanvasAgg(fig)
canvas.draw()
backgrounds = {}
lines = {}
neurons_position = {}
bars = {}
for nme, ax in axes.items():
    line, = ax.plot(phi, data[nme][0], '-')
    npos, = ax.plot(phi, np.ones_like(phi) * 0.4, 'o', color='black')
    backgrounds[nme] = canvas.copy_from_bbox(ax.bbox)
    lines[nme] = line
    neurons_position[nme] = npos

image = pyglet.image.ImageData(figw,
                               figh,
                               'RGB',
                               data=canvas.tostring_rgb(),
                               pitch=-3 * figw)


def update(dt):
    print(dt)
    window.clear()
    agent.update(dt)
    for nme in ['lmncw_*', 'lmnccw_*', 'adn_*']: