output windows in python
Posted: Thu Jun 11, 2009 11:09 pm
I have recently decided to learn the Python interface for Neuron. I decided the best way to learn would be to convert some of my old scripts from hoc to python. I came so close to being successful on my own, but I haven't been able to figure out how to control shape plots without invoking the hoc interpreter.
For example, right now I have
Instead of the first three (non-comment) lines, I tried to use "shapeWindow=h.newshapeplot()" That almost works: it opens the shape plot, but shapeWindow is 0.0 instead of a HocObject (and hence I can't use it to set the size, variable, etc...) What is the right way to do this?
Also, I'd appreciate any words of wisdom anyone has about the parameters for size and view. I use these values because they work; I have no idea what they mean. Thanks!
For example, right now I have
Code: Select all
# ready shape plot
h('{objectvar sw}')
h('{sw=new PlotShape(0)}')
shapeWindow=h.sw
shapeWindow.size(-380.24,488.164,-624.858,170.347)
shapeWindow.variable('ip3i_wf')
shapeWindow.view(-380.24, -624.858, 868.404, 1595.205, 0, 0, 584.64, 535.36)
shapeWindow.exec_menu('Shape Plot')
# necessary to make flushPlot() update shapeWindow
h.fast_flush_list.append(shapeWindow)
shapeWindow.scale(0,.002)
Also, I'd appreciate any words of wisdom anyone has about the parameters for size and view. I use these values because they work; I have no idea what they mean. Thanks!