Skip to content

Commit

Permalink
Add examples and view
Browse files Browse the repository at this point in the history
  • Loading branch information
lidakanari committed Jul 24, 2018
1 parent c414aa2 commit 8178c8e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 0 additions & 4 deletions examples/Advanced/variability.py
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,3 @@ def check_input_data(filename):

return len(L), counter_load, counter_process



def plot_average_on_population(pop):

9 changes: 8 additions & 1 deletion view/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ def soma(sm, plane='xy', new_fig=True, subplot=False, hadd=0.0, vadd=0.0, **kwa
return _cm.plot_style(fig=fig, ax=ax, **kwargs)


def neuron(nrn, plane='xy', new_fig=True, subplot=False, hadd=0.0, vadd=0.0, neurite_type='all', **kwargs):
def neuron(nrn, plane='xy', new_fig=True, subplot=False, hadd=0.0, vadd=0.0, neurite_type='all', rotation=None, **kwargs):
'''Generates a 2d figure of the neuron,
that contains a soma and a list of trees.
Expand Down Expand Up @@ -483,13 +483,20 @@ def neuron(nrn, plane='xy', new_fig=True, subplot=False, hadd=0.0, vadd=0.0, neu

to_plot = []

if rotation=='apical':
angle = _np.arctan2(nrn.apical[0].get_pca()[0], nrn.apical[0].get_pca()[1])
elif type(rotation) is list:
angle = _np.arctan2(rotation[1], rotation[0])

if neurite_type == 'all':
to_plot = nrn.neurites
else:
for neu_type in neurite_type:
to_plot = to_plot + getattr(nrn, neu_type)

for temp_tree in to_plot:
if rotation is not None:
temp_tree.rotate_xy(angle)

bounding_box = temp_tree.get_bounding_box()

Expand Down

0 comments on commit 8178c8e

Please sign in to comment.