Shape plot update from Python

When Python is the interpreter, what is a good
design for the interface to the basic NEURON
concepts.

Moderator: hines

Post Reply
ziemek
Posts: 22
Joined: Thu May 23, 2019 8:02 am
Location: Warsaw, Poland
Contact:

Shape plot update from Python

Post by ziemek » Mon Dec 02, 2019 1:22 pm

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?

ted
Site Admin
Posts: 5653
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Shape plot update from Python

Post by ted » Mon Dec 02, 2019 3:21 pm

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.

ziemek
Posts: 22
Joined: Thu May 23, 2019 8:02 am
Location: Warsaw, Poland
Contact:

Re: Shape plot update from Python

Post by ziemek » Tue Dec 03, 2019 3:06 am

It works straight forward. Thanks!

Post Reply