color or color_list procedures in PlotShape
Posted: Mon Jul 06, 2020 4:58 pm
Hi,
I am trying to plot the morphology of a neuron with a different color for each section. I am trying to use the PlotShape (really nice it is working with matplotlib now).
The code i am running is:
I tried to change the order of ax = ps.plot(pyplot) and to use the color_list function as well (commented out)
But it seems like none of the sections are colored (although the sectionlist is not empty)
What am i doing wrong?
Thanks!
I am trying to plot the morphology of a neuron with a different color for each section. I am trying to use the PlotShape (really nice it is working with matplotlib now).
The code i am running is:
Code: Select all
from neuron import h
from matplotlib import pyplot
mosinit_hoc = '/global/homes/r/roybens/Cori/NeuronInverter/NeuronStuff/hoc_templates/L5_TTPC1_cADpyr232_1/mosinit.hoc'
def plot_shape():
h.load_file(mosinit_hoc)
ps = h.PlotShape(False) # False tells h.PlotShape not to use NEURON's gui
#ps.color_list(h.cell.apical,3)
for curr_sec in h.cell.apical:
ps.color(curr_sec,4)
ax = ps.plot(pyplot)
pyplot.show()
ps = plot_shape()
But it seems like none of the sections are colored (although the sectionlist is not empty)
What am i doing wrong?
Thanks!