Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Allow multiple realtime raster plots #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Allow multiple realtime raster plots #1

wants to merge 2 commits into from

Conversation

sbrodeur
Copy link

No description provided.

sbrodeur added 2 commits May 11, 2013 11:15
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()
@mstimberg
Copy link
Member

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 StateMonitor.plot as well? This way, one could run for example https://github.com/brian-team/brian/blob/master/examples/misc/realtime_plotting.py in two figures instead of in two subplots. It also seems that RecentStateMonitor.plot and StateMonitor.plot do not have the newfigure keyword argument yet, for consistency it would be nice to have it there as well. If you see some opportunity for refactoring, i.e. removing some code duplication between raster_plot and StateMonitor.plot -- plase go ahead.

Sorry for becoming greedy 😄, just tell us if you don't have time for the additional fixes.

@sbrodeur
Copy link
Author

Hi Marcel,

That will be no problem! All the points/enhancements you mentioned are
now on my TODO list.
I previously had a harder time configuring the EGit plugin in Eclipse
than applying modification to the code! ;-)

Simon

Am Montag, den 13.05.2013, 03:19 -0700 schrieb Marcel Stimberg:

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 StateMonitor.plot as well? This way, one could run for
example
https://github.com/brian-team/brian/blob/master/examples/misc/realtime_plotting.py in two figures instead of in two subplots. It also seems that RecentStateMonitor.plot and StateMonitor.plot do not have the newfigure keyword argument yet, for consistency it would be nice to have it there as well. If you see some opportunity for refactoring, i.e. removing some code duplication between raster_plot and StateMonitor.plot -- plase go ahead.

Sorry for becoming greedy 😄, just tell us if you don't have time
for the additional fixes.


Reply to this email directly or view it on GitHub.


Simon Brodeur
Doctoral student
Université de Sherbrooke, Canada
Department of Electrical and Computer Engineering
NECOTIS laboratory, C1-3036
Phone : (819) 821-8000 ext. 62187
Email: [email protected]


@mstimberg
Copy link
Member

That will be no problem! All the points/enhancements you mentioned are now on my TODO list.

Cool, much appreciated!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants