Page 1 of 1

Shape plot update from Python

Posted: Mon Dec 02, 2019 1:22 pm
by ziemek
I would like to monitor "cai" variable across shape plot. After I execute this code it shows correctly what I want to monitor, except that it wont update with each steps:

Code: Select all

ps = h.PlotShape(True)
ps.variable('cai')
ps.scale(0, 0.01)
ps.show(0)
ps.exec_menu('Shape Plot')
When I specify the same parameters with mouse - it works and the plot is updates. So how to program it from the Python level?

Re: Shape plot update from Python

Posted: Mon Dec 02, 2019 3:21 pm
by ted
I would like to monitor "cai" variable across shape plot. After I execute this code it shows correctly what I want to monitor, except that it wont update . . .
When I specify the same parameters with mouse - it works and the plot is updates.
The Programmer's Reference documentation of PlotShape shows how to use Python to set up a false color plot, but doesn't show how to make it update automatically during a simulation. That's a pity, because if you're using NEURON's standard run time system, it's very easy to automate PlotShape updates. After your

ps.exec_menu('Shape Plot')

statement, just append the PlotShape to the standard run system's fast_flush_list. For your particular example, this

h.fast_flush_list.append(ps)

should do it.

Re: Shape plot update from Python

Posted: Tue Dec 03, 2019 3:06 am
by ziemek
It works straight forward. Thanks!