Allow multiple realtime raster plots#1
Allow multiple realtime raster plots#1sbrodeur wants to merge 2 commits intobrian-team:masterfrom sbrodeur:master
Conversation
The previous usage of pylab.gca() during the refresh operation caused
only the foreground figure to be updated.
One may validate the proper behavior now with this example script:
#################################################
from brian import *
import pylab
if __name__ == '__main__':
pylab.ion()
eqs = '''
dv/dt = (ge+gi-(v+49*mV))/(20*ms) : volt
dge/dt = -ge/(5*ms) : volt
dgi/dt = -gi/(10*ms) : volt
'''
P = NeuronGroup(300, eqs, threshold=-50*mV, reset=-60*mV)
P.v = -60*mV
Pe = P.subgroup(200)
Pi = P.subgroup(100)
Ce = Connection(Pe, P, 'ge', weight=1.62*mV, sparseness=0.02)
Ci = Connection(Pi, P, 'gi', weight=-9*mV, sparseness=0.02)
M1 = SpikeMonitor(Pe)
M2 = SpikeMonitor(Pi)
raster_plot(M1, newfigure=True, refresh=500*ms, showlast=1000*ms,
redraw=True)
raster_plot(M2, newfigure=True, refresh=100*ms, showlast=1000*ms,
redraw=True)
run(10*second)
pylab.ioff()
|
The patch looks good -- but I think it would be even greater if it could also fix the same issue for state monitor plots. Could apply your fix to Sorry for becoming greedy 😄, just tell us if you don't have time for the additional fixes. |
|
Hi Marcel, That will be no problem! All the points/enhancements you mentioned are Simon Am Montag, den 13.05.2013, 03:19 -0700 schrieb Marcel Stimberg:
Simon Brodeur |
Cool, much appreciated! |
No description provided.