In order to see the voltage, you would set cvar='voltage'.
from netpyne import specs, sim
netParams = specs.NetParams()
cellRule = netParams.importCellParams(
label='swc_cell',
fileName='BS0284.swc',
cellName='BS0284',
)
netParams.renameCellParamsSec('swc_cell', 'soma_0', 'soma') # rename imported section 'soma_0' to 'soma'
for secName in cellRule['secs']:
cellRule['secs'][secName]['mechs']['pas'] = {'g': 0.0000357, 'e': -70}
cellRule['secs'][secName]['geom']['cm'] = 1
if secName.startswith('soma'):
cellRule['secs'][secName]['mechs']['hh'] = {'gnabar': 0.12, 'gkbar': 0.036, 'gl': 0.003, 'el': -70}
netParams.popParams['swc_pop'] = {'cellType': 'swc_cell', 'numCells': 1}
cfg = specs.SimConfig()
cfg.filename = 'plotshape'
cfg.duration = 10
cfg.recordTraces = {'V_soma': {'sec': 'soma', 'loc': 0.5, 'var': 'v'}}
cfg.recordStep = 1
cfg.analysis['plotTraces'] = {'include': ['all'], 'saveFig': True}
sim.createSimulateAnalyze(netParams=netParams, simConfig=cfg)
sim.analysis.plotShape(cvar='voltage', includePre=[0], saveFig=True)
Unfortunately, we don't have a way to make movies from plotShape right now, but that is a feature that has been requested before, so we will look into adding that capability soon.
Please don't hesitate to ask if you have any more questions.