How to plot the morphology of a spatial neuron with 'generate_coordinates'

Description of problem
I tried to plot the morphology described in User’s guide by calling the generate_coordinates, but nothing was drawn. Is it necessary to create a ‘whole’ neuron with eqs and other objectives just like the example bipolar_cell ? I also added generate_coordinates to the end of bipolar_cell but no morphology was drawn either.

Minimal code to reproduce problem

from brian2 import *
morpho = Soma(diameter=30*um)
morpho.L = Cylinder(length=10*um, diameter=1*um, n=3)
morpho.L1 = Cylinder(length=5*um, diameter=1*um, n=3)
morpho.L2 = Cylinder(length=5*um, diameter=1*um, n=3)
morpho.L3 = Cylinder(length=5*um, diameter=1*um, n=3)
morpho.R = Cylinder(length=10*um, diameter=1*um, n=3)
morpho.RL = Cylinder(length=5*um, diameter=1*um, n=3)
morpho.RR = Cylinder(length=5*um, diameter=1*um, n=3)

new_morpho = morpho.generate_coordinates()
show()

What you have aready tried
Adding new_morpho = morpho.generate_coordinates() to the example bipolar_cell to see whether it works.

Expected output (if relevant)
A similar output should be like this (in User’s guide):

Actual output (if relevant)
Nothing was drawn

Full traceback of error (if relevant)

Hi @czx. The generate_coordinates method does not draw anything, it will only add x and y (and optionally, z) coordinates to the morphology. Drawing such a morphology needs to be done either manually, or using the plotting tools in the brian2tools package: Plotting tools — brian2tools documentation

1 Like