# Plot simple morphology (single dendritic branch)

**URL:** <https://brian.discourse.group/t/plot-simple-morphology-single-dendritic-branch/506>\
**Category:** Support\
**Created:** [26 October 2021 09:54 UTC](https://brian.discourse.group/t/plot-simple-morphology-single-dendritic-branch/506 "2021-10-26T09:54:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shirin](https://avatars.discourse-cdn.com/v4/letter/s/df788c/32.png) [@shirin](https://brian.discourse.group/u/shirin)\
**Post date:** [26 October 2021 09:54 UTC](https://brian.discourse.group/t/plot-simple-morphology-single-dendritic-branch/506/1 "2021-10-26T09:54:09Z")

</div>

# Description of problem

I want to plot just a simple compartmental branch by using the command below(which was in the “User’s guide” ):  
morpho=Section(n=5, diameter=[15, 5, 10, 5, 10, 5]\*um, length=[10, 20, 5, 5, 10]\*um)

# Minimal code to reproduce problem

morpho = morpho.generate\_coordinates()  
plotting.morphology.plot\_morphology(morpho,plot\_3d=False)

without defining Soma I get an error that says: float division by zero

# What you have already tried

I added Soma by :  
morpho = Soma(diameter=3\*um)  
morpho.child=Section(n=5, diameter=[15, 5, 10, 5, 10, 5]\*um, length=[10, 20, 5, 5, 10]\*um)

and it got fixed. but I don’t want to have soma in my simulation. where did I make a mistake? and is it possible to have a simulation without soma? just a single dendritic branch?

---

<div class="post-metadata">

**Author:** ![mstimberg](https://yyz2.discourse-cdn.com/free1/user_avatar/brian.discourse.group/mstimberg/32/11_2.png) [@mstimberg](https://brian.discourse.group/u/mstimberg)\
**Post date:** [26 October 2021 14:06 UTC](https://brian.discourse.group/t/plot-simple-morphology-single-dendritic-branch/506/2 "2021-10-26T14:06:11Z")

</div>

Hi @shirin. The `generate_coordinates` method is meant to generate coordinates for an artificial morphology so that it “looks nice”. Admittedly it should not generate an error for a morphology that only has a single section, but in either case it will not be very useful. As a workaround, you can directly set coordinates yourself instead of specifying the length of your compartments:

```Python
morpho = Section(n=5, diameter=[15, 5, 10, 5, 10, 5] * um,
                 x=[0, 10, 30, 35, 40, 50] * um)
plot_morphology(morpho, plot_3d=False, show_diameter=True)

```

Note that I also set the `show_diameter` option, otherwise you’d only see a simple line.  
 ![morphology](https://global.discourse-cdn.com/free1/uploads/brian/original/1X/4b12f1f309789e39aea86d39211d77890ba9fbdc.png)

> [@shirin](#):
>
> and is it possible to have a simulation without soma? just a single dendritic branch?

It is perfectly fine to have a simulation without the soma (like in a number of examples in the documentation, e.g. [Example: cylinder — Brian 2 2.5.4 documentation](https://brian2.readthedocs.io/en/stable/examples/compartmental.cylinder.html)), your problems are only related to _plotting_ such morphologies.
